Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
problem with javascript
#1
Not Solved
Hello,

In my web page, I have an Input field with two events (onkeyup and onchange) calling a javascript function.
This javascript checks if the size’s value is 5. If so, the form is submit and the same screen is display.

My problem : When I made a record, if I write 5 characters, the event is not recorded.
Remark : If I write 2 characters and I quit the field it’s OK.


My input field
Code:
<input type="text" name="codePostal" onkeyup="javascript:cpAction();" onchange="javascript:cpAction();">


My javascript
Code:
function cpAction(){
            var cp = formulaire.elements['codePostal'].value
            if( ((cp.length == 5) && (estValideCodePostal(cp))) || (cp.length == 0) ){
                        aValider = false;
                        formulaire.elements['reqCode'].value='display';
                        formulaire.submit();
            }
}



Thank's
Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
Wink Webedit Javascript sync issue praveenzack 3 3,272 10-10-2012, 06:25 PM
Last Post: praveenzack
  javaScript on webSite application yaniv mendelson 2 2,627 10-05-2010, 06:27 PM
Last Post: yaniv mendelson
  How to run script written in Javascript using QTP 9.0 scrapspace 1 6,099 02-26-2009, 08:28 AM
Last Post: tarunlalwani
  How to write QTP script in Javascript scrapspace 2 10,484 02-25-2009, 10:00 AM
Last Post: tarunlalwani

Forum Jump:


Users browsing this thread: 1 Guest(s)