Click here to Skip to main content
16,012,025 members

Comments by codegirl24 (Top 9 by date)

codegirl24 18-Apr-13 3:22am View    
I am using simple HTML code and javascript functions. But the above link is the exact scenario..I am not sure if i can resolve this problem with ASP.NET...please help
codegirl24 15-Apr-13 13:16pm View    
Prasad: What is /gi here?
And the problem I am facing is : generally if i enter a phone number like 9880228876,it must not show any error meaning the phone number is acceptable.
But with the above regex it gives an error for above phone number too as invalid number.
Can you please tell me how and where should i improvise?
codegirl24 15-Apr-13 4:23am View    
Prasad Khandekar :Hi,
I have used the above regex for same problem i was facing..But the problem is its not allowing numbers like 78890923454 also...meaning 22,88,99 like numbers also are showing error...But phone numbers can have such numbers in sequence right? Ex:98825609978 etc..
Waiting for your reply...Please guide on this.
codegirl24 8-Apr-13 4:00am View    
Manoj :

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML>
<HEAD>
<TITLE> New Document </TITLE>
<META NAME="Generator" CONTENT="EditPlus">
<META NAME="Author" CONTENT="">
<META NAME="Keywords" CONTENT="">
<META NAME="Description" CONTENT="">
<script type="text/javascript">
function formValidation(){
var dateString=document.form1.date.value;
if(checkDate(dateString)){
}
return false;
}
function checkDate(dateString) {

var today = new Date();
var todayFormat = today.format("MM/dd/yyyy");
var endDate = formatDate(dateString);
if (endDate > todayFormat) {
alert("Entered date must be earlier than or equal to current date!");
}
}

function formatDate(dateString) {
var datePart = dateString.match(/\d+/g);
var day = datePart[0]
var month = datePart[1]
var year = datePart[2];
var myDate = month + '/' + day + '/' + year;
return myDate;
}

</script>

</HEAD>
<BODY>
<form name ="form1" action="">
*Date(mm/dd/yyyy)<br><input type="text" name="date">
<input type="button" value="Done" önclick="formValidation();">
</BODY>
</BODY>
</HTML>
--------------------------------
This is my code Can you please tell me where I have gone wrong?
Sorry for replying late...Thanks a lot for the solution.
codegirl24 10-Mar-13 16:05pm View    
Thanks for the suggestions.. I wasn't trying not to answer any further questions over my problem..But being a member it would be nice to be asked about anything in a much better tone..One of my friend too tried posting questions and ThePhantomUpvoter tried questioning rudely and was not providing any help for the problem we were facing..
Thanks again for the solution too..I will try out with this option too.