• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

issue with onblur and onClick

 
Greenhorn
Posts: 21
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
let me see if I can explain this clearly:

I have a form. Among other form elements, there's a text input field (with it's onBlur event) and an "Submit/Approve" button (with it's onClick event).

What's supposed to happen is when a user entered text, once they get out of that field, for some validation to kick off. This validation is to pass the form to another page, like this:
document.myform.action = "Apova1.jsp?mode=ChkAcc&mcu="+Mcu+"&obj="+Obj;
document.myform.method = "post";
document.myform.submit();

In trying to debug this what I seem to find out is this:
- when I tab out of the field, the onblur event is kicked off and it works ok.
- however if after I enter text, then without tabbing out, I click the Approve button, it does not seem to execute the 3 lines of code I mentioned above, thus the validation is not done.

Any ideas/suggestions what's wrong here?
 
author
Posts: 15385
6
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Try to set the form's action and validation on the onsubmit handler of the form.

Eric
 
reply
    Bookmark Topic Watch Topic
  • New Topic