Results 1 to 4 of 4
- 06-27-2012, 11:50 AM #1
Member
- Join Date
- Feb 2012
- Posts
- 23
- Rep Power
- 0
Browser minimizes but then comes back again automatically! Java Script problem!
Hi all,
I am trying to do date validation in my html page using javascript.My code is as follows:
HTML code:
XML Code:<td><input name="expires" id="expires" type="text" onblur="Date_Validator2();" ></td>
Java Code:function Date_Validator2(){ var chkdate = document.getElementById("expires").value; if(chkdate == "") { alert("Please enter the Date..!!"); PostAvailableBench.expires.focus(); break; }else if(chkdate.match(/^\d{4}\-\d{2}\-\d{2}$/)) { alert('works out'); } else { alert("date format should be YYYY-MM-DD"); PostAvailableBench.expires.focus(); break; } }
the problem here is :
After trying to test my code by entering the date value, I try to minimize the browser to carry on with the rest of the coding.. But the browser immediately comes back up with out even clicking on it and starts to give alert messages.. Im not really able to figure out what could be the problem..?Is it that my if statement goes into a loop due to something or anything else that I am not aware of ?
I would be glad if someone could help.. Thank You
- 06-27-2012, 12:06 PM #2
Moderator
- Join Date
- Apr 2009
- Posts
- 13,541
- Rep Power
- 27
Re: Browser minimizes but then comes back again automatically! Java Script problem!
Java != Javascript.
You need to find a Javascript forum.Please do not ask for code as refusal often offends.
** This space for rent **
- 06-27-2012, 12:36 PM #3
Senior Member
- Join Date
- Apr 2010
- Location
- Belgrade, Serbia
- Posts
- 278
- Rep Power
- 11
Re: Browser minimizes but then comes back again automatically! Java Script problem!
@javabeginner29 why you are using this line of code: PostAvailableBench.expires.focus(); ?
What's purpose of that line of code?
Can you give me a full code that I can copy+paste it to .html file to see If I could help you.
- 06-28-2012, 10:02 PM #4
Similar Threads
-
Scriptlet Not Running on JSP after coming back from back button of browser
By jason.3dmagic in forum JavaServer Pages (JSP) and JSTLReplies: 4Last Post: 06-23-2011, 08:44 AM -
Browser's back button refresh the pages
By hasansheikh18 in forum JavaServer Pages (JSP) and JSTLReplies: 3Last Post: 05-31-2011, 05:44 PM -
How to run jsp in eclipse which automatically open browser with appropriate path?
By Kaviarasan in forum Advanced JavaReplies: 1Last Post: 04-15-2011, 05:36 PM -
problem with back button of the browser.
By shivakumari in forum Java ServletReplies: 2Last Post: 03-25-2009, 08:41 AM -
How to get automatically opened a pdf form using js script and HTML?
By mravihpcl in forum New To JavaReplies: 0Last Post: 03-23-2009, 05:19 PM
Bookmarks