• Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
    Dedicated community for Japanese speakers
  • 한국 커뮤니티
    Dedicated community for Korean speakers
Exit
0

form onblur event

New Here ,
Oct 13, 2006 Oct 13, 2006

Copy link to clipboard

Copied

I am placing all my edits for a form on each form field onBlur() event. I usually use the onSubmit event, but I can't use the onSubmit event in this situation.

I only have a problem when there are 2 form fields with onBlur events in sequence.
When you leave the focus for the first entry - social -the alert box for the next entry co-social displays also. You then have to go to the task manager to delete the session. The following is the code for 2 form fields with onBlur events in sequence:

<td colspan="2"><font face="Arial, Helvetica, sans-serif" size="3">
<input type="TEXT" value="" size="20" maxlength="11" name="social" onKeypress="if (event.keyCode < 48 && event.keyCode != 45 || event.keyCode > 57 ) event.returnValue = false;" onBlur = "if (!document.loanapp2.social.value){alert('Borrower Social security number is a required entry!');document.loanapp2.social.focus();return false;};">
</font></td>
<td width="37%"><font face="Arial, Helvetica, sans-serif" size="3">
<input type="TEXT" value="" size="20" maxlength="11" name="co_social" onKeypress="if (event.keyCode < 48 && event.keyCode != 45 || event.keyCode > 57 ) event.returnValue = false;" onBlur="if(document.loanapp2.co_lastname.value != '' && document.loanapp2.co_social.value == ''){alert('Co-borrower Social Security Number must be entered if Co-borrower name is entered!');document.loanapp2.co_social.focus();return false;};" >
</font></td>
TOPICS
Advanced techniques

Views

440

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
Oct 13, 2006 Oct 13, 2006

Copy link to clipboard

Copied

Use onChange instead of onBlur.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Oct 13, 2006 Oct 13, 2006

Copy link to clipboard

Copied

LATEST
The onChange event will not work because these entries need to be required.


Thanks for your input.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Resources
Documentation