Form Submission Handler Problem in MSIE

Hello,

I'm having a form submission problem in MS Internet Explorer.  Everything works fine in Chrome and Firefox.  But in MSIE, when I press the form's submit button, nothing happens unless a specific form field is already coded.  When I code the specific field in MSIE, then my form validator runs as desired.

Oddly, in IE, when I leave the specific form field blank, on form submit the mouse cursor jumps into the form field in question, instead of running the form validator.  Admittedly, the specific field is complex.  When it is populated with user input, on blur (mouseout) a JS AJAX call is made to a script at another server to pull in some data from the DB at the remote domain.  The AJAX functionality works perfectly in all browsers.  But again, the issue is that the particular field must be filled in MSIE or the form's submit handler won't run at all.  I'm not having this problem in any other browsers (Chrome for PC, Firefox for PC, Android for mobile, iPhone for mobile).

I'm using MSIE 11 on Windows 7 with a 4-core hyperthreaded XEON processor array.

Any help would be most appreciated.

Thanks, Stu Engelman
stuengelmanAsked:
Who is Participating?
 
RobOwner (Aidellio)Commented:
I think it has something to do with

onblur="return zip_onblur(this.value)"

remove the "return"
0
 
RobOwner (Aidellio)Commented:
Stu,

Can you please post the code relevant to the form.  It's impossible to know exactly what's going on without it.

Rob
0
 
stuengelmanAuthor Commented:
Hi Rob,

Will post the code today.

Sorry for the late response (was on vacation last week).

Stu
0
Free Tool: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

 
RobOwner (Aidellio)Commented:
Whenever you're ready.  I'm monitoring the question :)
0
 
stuengelmanAuthor Commented:
Hi Rob,

Thank you so much.  I'll get to you tonight or tomorrow morning.  I had a long vacation, with alot of traveling time, and I'm really wiped out at the moment.  But I very much appreciate your help, and I will contact you ASAP.  Thanks so much for your help.

Best, Stu
0
 
stuengelmanAuthor Commented:
Hi Rob,

Sorry for the delay in getting back to you.  Things were very hectic here after being away for a week.

You can see the live page at http://www.legalhelprightnow.org/bpi/index.asp.  As long as the Zip Code field is filled in, the submit button is active (for example, it will pop a validator dialog showing which fields are not yet filled in).  But if the Zip Code field is not filled in, pressing the submit button does nothing (no validator popup, even if all form fields are blank).

The Zip Code field has an "onblur" (onmouseout) event handler.  After a user types in a zip code, and then moves the cursor to another control for additional data input, the onblur handler uses the zip code entered to look up the State from a DB table at a remote server.  The State is then displayed within the form, and is also stored in a hidden textbox for submission to the form handler script once the submit button is pressed with all form fields filled in, and all form field syntax is correct where syntax checking done (e.g., phone number, email address, etc.).

The Zip Code auto-lookup for State works fine in all browsers.  Also, I have no form submission issues (validation, actual form submission) in any browsers except MSIE.  It appears that for MSIE only, the submit button is somehow disabled, or at least not calling the form validation script, unless the Zip Code field is filled in.  It's also possible that the form validation script, or some other Javascript on the page, has syntax that is no longer permitted in MSIE (i.e., a script abend is occurring, stopping the page code dead).

I've attached the code for the page in question.  Please try to avoid pressing the submit button with all fields filled in, as this will send your test input to system clients.  If performing a full form submission is unavoidable for testing purposes, please use the name "Steve Fake", and let me know that you did it, so I can clean up the DB and reverse financial debits to client accounts.  If the page code is too long or complicated to easily follow, let me know, and I'll color code the JS/HTML that is most connected to the Zip Code field.  The real name of the file is index.asp, but I named it index.txt for upload as EE does not permit upload of ASP files.  It's a little messy in Notepad, but easier to read in Wordpad.

Thanks, Stu
index.txt
0
 
RobOwner (Aidellio)Commented:
I don't believe it's your code but one of the js libraries you're using (there seem to be quite a lot on your page).  To see what I mean, I copied your form and javascript to jsbin

http://jsbin.com/wojiri/1/edit?html,js,output

View that will IE and you'll see that your error message is displayed.

=====
As a side note, when viewing your site with Chrome, I noticed the form doing weird things where some of the fields would go dark and light as if there was some issue redrawing the page.
0
 
stuengelmanAuthor Commented:
Hi Rob,

I'm a little confused.  I opened http://jsbin.com/wojiri/1/edit?html,js,output in MSIE, and could see that the form's validator popup was working properly.  Does jsbin.com implement its own version of JS that overrides what MSIE provides?  While jsbin.com may be able to run my code, just like Chrome and FF can, I'm still left with the problem that MSIE itself can't run it properly (as a direct download).

Actually, I recently had many problems with this page in FF too, due to recent changes in FF's standards for JS.  I was able to diagnose and fix them all.  I suspect the same issue is responsible for the MSIE problem, as the page used to work perfectly in all browsers (MSIE, FF, and Chrome).

Not sure what your Chrome issue is.  I cannot duplicate it.  The page comes up perfectly for me in Chrome, and all functionality is normal.

I guess at this point the question is: what do I do to get the code to work properly in MSIE?

Thanks, Stu
0
 
RobOwner (Aidellio)Commented:
Sorry, that was my point that MSIE works for the jsbin example because I removed all unnecessary js libraries you have on your site.

I've also traced it to your onblur even on the zipcode.  Please remove that for now and see if your form validates
0
 
stuengelmanAuthor Commented:
Hi Rob,

I can remove the onblur handler from the code, but the reality is that I need it, since the page obtains the State of the user from a remote DB after the user provides the zip code and mouses out of that field.

I guess the question at this point is: why is my zip code onblur handler compatible with FF and Chrome, but not IE?  The handler used to work in all three browsers, so I suspect something in MSIE JS syntax standards changed in a recent version update.

Stu
0
 
stuengelmanAuthor Commented:
Hi Rob,

I'll give that a try.  I think you may be on to something, as the zip code field is the only form field with an onblur event attached to it.  The issue may be that MSIE's current implementation of JS requires a different value format for the onblur parameter than other browsers (your idea above), or may require a different  parameter (event) name (e.g., something like "onmouseout" instead of "onblur").  I may have to code a simple browser sniffer to toggle the syntax for MSIE vs. other browsers, but this is easy to do.  Let me give your idea a try and I'll report back.

Thanks, Stu
0
 
RobOwner (Aidellio)Commented:
Sorry Stu, just been travelling so only just seen your comment but hopefully is promising. I'll be monitoring.
0
 
stuengelmanAuthor Commented:
Hi Rob,

No problem.  Have been very busy with a client emergency.  Will get back to you shortly.

Best, Stu
0
 
stuengelmanAuthor Commented:
Hi Rob,

Thanks so much for your help.  Your solution of 2015-06-12 @ 00:57:51 made my form more stable in IE.  I also had to make some changes to recently deprecated JS syntax related to browser sniffing, and custom jQuery based placeholders that don't integrate well with form fields containing event handlers in MSIE (such as my field with the onblur event).

Sadly, all of the above worked perfectly in all browsers only a couple months ago.  But as browsers get updated, JS syntax standards change, without any notice.  The exact same page was going wild in Firefox on a different just issue after their latest update - form fields containing programmatic toggles for visibility based on user input in other form fields would fly to weird locations on the page, and become read-only preventing user input.  Unannounced changes to FF CSS standards were the culprit; this took several hours to investigate and fix.

At any rate, thanks for all your help in getting me to a final solution.

Best regards, Stu
0
 
stuengelmanAuthor Commented:
Very good input that led me to a complete solution.
0
 
RobOwner (Aidellio)Commented:
Good to hear it's working Stu.
0
 
stuengelmanAuthor Commented:
Thanks for all your help Rob.  It's sad that the browser makers are not more in sync with each other, and more proactive about announcing standards changes in advance.  I think their goal is to "differentiate" to create market advantage, but all they're doing is creating confusion.  It would be best if they all went to W3C standards for JS/HTML, and differentiated on technology (paint speed, tab multi-threading, debugging features, etc.) rather than coding standards.
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.