In my form I am using drop down for showing day, month, year. can you help me to validate the date. I have to validate the entered age is greater than 15. also checking leap year
Can u show me completed html code where it is some rectangle in it with "height=75% of my screen" and "widtht=4/3 of height". So, it should be 3:4 re?tangle where height depends of my screenheight, but width do not depends of my screenwidth. Only of screenheight.
i thought i understood previus time, but it was not so.
I have this:
<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.3.2/jquery.min.js"></script>
<script type="text/javascript" src="colorbox/jquery.colorbox.js"></script>
<script type="text/javascript">
$(document).ready(function(){
$(".example7").colorbox({width:"80%", height:"80%", iframe:true});
});
</script>
And i dont know what to do with the width.
I'm trying to validate the entry of text using Python/tkInter
def validate_text():
return False
text = Entry(textframe, validate="focusout", validatecommand=validate_text)
where validate_text is the function - I've tried always returning False and always returning True and there's no difference in the outcome..? Is there a set of arguments in the function that I need to include?
Edit - changed from NONE to focusout...still not working
For the love of God I am not getting this easy code to work! It is always alerting out "null" which means that the string does not match the expression.
var pattern = "^\w+@[a-zA-Z_]+?\.[a-zA-Z]{2,3}$";
function isEmailAddress(str) {
str = "[email protected]";
alert(str.match(pattern));
return str.match(pattern);
}
Google Maps newbie (GIS newbie), I'm looking at a solution to map an overlay (number of polygons) on-top of Google maps and wondered if using a KML file was a viable solution?
Basically, I have a number of address (address data) that I will pass to our internal GIS system, the GIS system hands me back a KML file (one file with a number of different locations) and then I draw the polygon using the KML Layering options:
https://developers.google.com/maps/documentation/javascript/layers
Sound like a viable solution?
Cheers
I have a java application that connects to a webservice over https.
The domain where i host the webservice has a valid Goddaddy issued SSL certificate.
The application works fine on Windows but on MacOSx i receive the following exception when attempting to connect to the webservice via https.
sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid certification path to requested target
I've tested it on two machines running Mac OS X 10.7.2 with the latest java runtime updates.
I understand this is usually a problem with self signed certificates that need to be added manually, but i have a valid Godaddy issued certificate.
In webbrowsers (safari & firefox) on mac os the certificate is recognized and seems ok. I even tried adding the certificate to the key chain manually like in the gase of a self signed one but to no result.
I have a required attribute that used with resources:
public class ArticleInput : InputBase
{
[Required(ErrorMessageResourceType = typeof(ArticleResources), ErrorMessageResourceName = "Body_Validation_Required")]
public string Body { get; set; }
}
I want to specify the resources be convention, like this:
public class ArticleInput : InputBase
{
[Required2]
public string Body { get; set; }
}
Basically, Required2 implements the values based on this data:
ErrorMessageResourceType = typeof(ClassNameWithoutInput + Resources); // ArticleResources
ErrorMessageResourceName = typeof(PropertyName + "_Validation_Required"); // Body_Validation_Required
Is there any way to achieve something like this? maybe I need to implement a new ValidationAttribute.
I'm trying to validate a UI change when Enter key is pressed. The UI element is a textbox, which is data binded to a string. My problem is that the data binding hasn't updated TestText when Enter key is Up. It is only updated when I press the button which brings up a message box.
/// <summary>
/// Interaction logic for Window1.xaml
/// </summary>
public partial class Window1 : Window, INotifyPropertyChanged
{
String _testText = new StringBuilder("One").ToString();
public string TestText
{
get { return _testText; }
set { if (value != _testText) { _testText = value; OnPropertyChanged("TestText"); } }
}
public Window1()
{
InitializeComponent();
myGrid.DataContext = this;
}
private void OnPropertyChanged(string property)
{
if (PropertyChanged != null)
{
PropertyChanged(this, new PropertyChangedEventArgs(property));
}
}
public event PropertyChangedEventHandler PropertyChanged;
private void onKeyUp(object sender, KeyEventArgs e)
{
if (e.Key != System.Windows.Input.Key.Enter) return;
System.Diagnostics.Trace.WriteLine(TestText);
}
private void button1_Click(object sender, RoutedEventArgs e)
{
MessageBox.Show(TestText);
}
}
Window XAML:
Window x:Class="VerificationTest.Window1"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
Title="Window1" Height="300" Width="300" KeyUp="onKeyUp"
TextBox XAML:
TextBox Name="myTextBox" Text="{Binding TestText}"
Button XAML:
Button Name="button1" Click="button1_Click"
Hi, I'm currently developing an ajax application and I'm looking for a feature that lets me intercept all static and dynamic links using javascript. The links look like these:
<a href="link1/">link 1</a>
<a href="link2/">link 2</a>
etc.
I then want the browser to redirect to: current.page/#link1/ rather than current.page/link1/. I'm using jQuery, so the live() function is an option, however using that as a solution just seems rather sluggish to me(am I hysterical?). If there is a way to intercept ALL links on a page, maybe through detecting a change in the address, that would greatly help. I've tried a few plugins for jQuery (jQuery address & SWFaddress) but they only seem to have event handlers that respond to changes in anchor tags in the address. Any ideas?
thanks for your time
I'm trying to construct a regex to screen valid part and/or serial numbers in combination, with ranges.
A valid part number is a two alpha, three digit pattern or /[A-z]{2}\d{3}/
i.e. aa123 or ZZ443 etc...
A valid serial number is a five digit pattern, or /\d{5}/
13245 or 31234 and so on.
That part isn't the problem. I want combinations and ranges to be valid as well:
12345, ab123,ab234-ab245, 12346 - 12349 - the ultimate goal. Ranges and/or series of part and/or serial numbers in any combination. Note that spaces are optional when specifying a range or after a comma in a series. Note that a range of part numbers has the same two letter combination on both sides of the range (i.e. ab123 - ab239)
I have been wrestling with this expression for two days now, and haven't come up with anything better than this:
/^(?:[A-z]{2}\d{3}[, ]*)|(?:\d{5}[, ]*)|(?:([A-z]{2})\d{3} ?- ?\4\d{3}[, ]*)|(?:\d{5} ?- ?\d{5}[, ]*)$/
...
My Regex-Fu is weak.
I have a user who's having issues running the JCarousellite plug-in in IE8. Not just on my own site, but also on the jcarousellite homepage (http://www.gmarwaha.com/jquery/jcarousellite/) It runs fine on my own machine and all his IE Security settings/levels are the same as my own (Secruity is at "Medium-High" and Privacy at "Medium"). JQuery also seems to be working for him as other aspects controlled by jquery on the site are functioning correctly.
I use Firefox normally, so am not aware of every feature IE8 offers, but am thinking he has some setting/option set incorrectly.
Anyone experienced something similar or have any suggestions for settings I could look at changing? Thanks
Hi
just wondering if its possible to have a hidden parent and a visible child with css or jQuery,
basically on some certain pages I'm trying to make a child element visible even though the parents are hidden,
var bodyClass = jQuery('body').attr('class');
//alert (bodyClass);
var searchTerm = 'category-mens';
var searchTerm2 = 'category-ladies';
if((bodyClass.search(searchTerm) || bodyClass.search(searchTerm2)) != -1) {
jQuery('.nav-container ul.level0 li.level1 ul.level1 li.level2 ul.level2 li.first a span').css({
'display':'block',
'position':'absolute',
'top':'500px',
'left':'500px'
});
}
at the moment it doesn't work because the li.level2 is hidden.
Thanks for the help.
I am trying to implement a type of slider using jquery. However this question is about the CSS involved in trying to achieve the functionality.
My site design occupies a central column of width 960px. Within this layout there is a central element, that I wish to slide right, on click of a "next" button, and at the same time, another element of the same class slides in from the left to occupy the space vacated. I have drawn a diagram of what I am trying to achieve.
In this diagram the red blocks are the element I want to slide in and out, it is grouped by a div which moves left to produce the effect using jQuery
I have 2 main questions:
How do I get the correct margin values, given that the browser window width can vary and that all elements that are not the current item should be offscreen?
2.If the user were to resize the margins could be dynamically altered based on the values returned using the jQuery resize() event. Or is there a neater quicker better way of doing it using pure CSS?
I always wondered why jQuery returns true if I'm trying to find elements by id selector that doesnt exist in the DOM structure.
Like this:
<div id="one">one</div>
<script>
console.log( !!$('#one') ) // prints true
console.log( !!$('#two') ) // is also true! (empty jQuery object)
console.log( !!document.getElementById('two') ) // prints false
</script>
I know I can use !!$('#two').length since length === 0 if the object is empty, but it seems logical to me that a selector would return the element if found, otherwise null (like the native document.getElementById does).
F.ex, this logic can't be done in jQuery:
var div = $('#two') || $('<div id="two"></div>');
Wouldnt it be more logical if the ID selector returned null if not found?
anyone?
Have a text field in the jsp which shows and takes input for ftp Url like below :
ftp://ftplog:*****@10.203.291.177/abc/DS/Simulator/B11/B11/L2
The password field above is masked . Now when user tries the edit say ftp to sftp or File Path , He should re-type the password too , other wise What I will be getting in server is only "*" .
Can somebody suggest the best way of validating this . It has a lot of test cases that has to be taken care of .
Thanks .
In the example below I am wanting to do all of the 'safety' checks on the $_POST variables but it seems when I click submit I get a white page why? I am wanting it to show the errors etc
Form Process:
/* check if the form is submitted */
if (isset($_POST['submitButton'])) {
$fullName = $_POST['fullname'];
if($_SERVER['REQUEST_METHOD'] == 'POST' && !empty($fullName))
{
if (!ctype_alpha(str_replace(array("'", "-"), "",$fullName))) {
$errorfullName .= '<span class="errorfullName">*First name should be alpha characters only.</span>';
}
if (strlen($fullName) < 3 OR strlen($fullName) > 40) {
$errorfullName .= '<span class="errorfullName">*First name should be within 3-40 characters long.</span>';
}
}
}
i have already user observe field in cakephp 1.3 Now i want to do the same thing in cakephp 2.0
I have one form.there is a one field named email. When user insert email. onblur there is a popup one message that displays "email already exists" or "right"
for that i have write below code in my projects. the below code is my add file code
<?php $options = array('url' => array( 'controller' => 'users', 'action' => 'is_exist'), 'update' => 'email_exist');
echo $this->ajax->observeField('UserEmailId',array('url' => array( 'controller' => 'users', 'action' => 'is_exist'), 'update' => 'email_exists')); ?>
In my controller i have created one function like
public function is_exist($id = null)
{
$result = "yes";
$this->set('existdata',$result);
}
i have also created is_exists.ctp fiel in view/uers.
i dont know why its not working.
i did the same thing in Cakephp 1.3 and its working file but not in cakephp 2.0
can anyone tell me how i implement this ?
thanks in advance
i dont know whether am only getting this problem or some one else.
When entering string as input in the quantity filed of addtocart input box it never throws error and it takes as 1. how can i validate it. bcz they already made onclick function on addtocart function.
Please help me to solve this
I'm using an HttpWebRequest object to access a web service via an HTTP POST. Part of the requirement is that I:
Verify that the URL in the certificate matches the URL I'm posting to
Verify that the certificate is valid and trusted
Verify that the certificate has not expired
Does HttpWebRequest automatically handle that for me? I'd assume that if any of these conditions came up, I'd get the standard "could not establish trust relationship for the SSL/TLS secure channel" exception.
I've got portions of pages being replaced with HTML retrieved via AJAX calls. Some of the HTML coming back has JavaScript that needs to be run once in order to initialize the accompanying HTML (setting up event handlers).
Since the document has already been loaded, when I replace chunks of HTML using jQuery's .html function, having jQuery(document).ready(function() {...}); doesn't execute since the page loaded long before and this is just a snippet of HTML being replaced.
What's the best way to attach event handlers whose code is packaged along with the HTML it's interested in, when that content is loaded via AJAX? Should I just put a procedural block of javascript after the HTML , so that when I insert the new HTML block, jQuery will execute the javascript immediately? Is the HTML definitely in the DOM and ready to be acted upon by JavaScript which is in the same .html call?
Every time I try to submit the form and I have not entered nothing in the year field I get Incorrect year! how can I still submit the form without having to enter a year. In other words leaving the year field blank and not getting a warning?
Here is the PHP code.
if(preg_match('/^\d{4,}$/', $_POST['year'])) {
$year = mysqli_real_escape_string($mysqli, $_POST['year']);
} else {
$year = NULL;
}
if($year == NULL) {
echo '<p class="error">Incorrect year!</p>';
} else {
//do something
}
I have a task to validate addresses entered into a system I am currently creating. The system requires that address entered are validated against a valid data source. In the UK the dataset comes from the Royal Mail and is expensive to access.
The data needed is post code info for the whold of europe to start with accessed by an API into the web application.
There are a number of companies that offer this service,
QAS
Capscan
Postcode anywhere
These all offer the service I require. However this is expensive and in some cases not a complete data set. e.g. not Ireland
I was also wondering if there would be a way to utalis the google maps API to validate this data via postal code and country.
Would the google maps method be possible or do I have to go down the line of one of these expensive companies? Any thoughts on what line I should take.
Hi all,
I want to check that the credit card number provided by customer to my site is valid or not for further transaction. for that i wand to only verify taht the CC no is valid or not by Paypal.
A method for that can be with paypal api
step 1: DoDirectPayment with PAYMENTACTION=Authorization for amt of $1, then
step 2: DoVoid that request
Does any one can tell me
is any amount is charged by paypal for doing tis stuff?
or any other better way you know?
My site is in PHP..
Hi guys.
I have a table that has a column called "rowguid" with default value of newguid(). After I delete the generated property in the Entity Framework 4.0 designer, whenever I try to build or validate the model I receive the following error message.
Error 3023: Problem in mapping
fragments starting at line 1460:Column
People.rowguid in table People must be
mapped: It has no default value and is
not nullable.
It's an obvious error message but the problem is that the column HAS default value.
Does anyone knows what the problem is?
Thanks.