Solved

Issue in onsubmit in internet explorer

Posted on 2011-09-06
15
312 Views
Last Modified: 2013-01-17
i have an issue in onsubmit event. It must return true or false while click enter key button in keyboard, in ie 7,8 it always returns true.

Any suggestions.

Thanks for help
0
Comment
Question by:Praveen_Bobbili
  • 7
  • 7
15 Comments
 
LVL 17

Expert Comment

by:OmniUnlimited
ID: 36488110
Under what conditions would it return false?  Can you post some code?
0
 
LVL 82

Expert Comment

by:leakim971
ID: 36488212
you don't handle key event the same way on IE and FF.
Check Which key has been pressed? section on this page : http://www.quirksmode.org/js/events_properties.html
0
 
LVL 1

Author Comment

by:Praveen_Bobbili
ID: 36707685
Below is source code..........

onsubmit=javascript:return CheckForOptions('QuestionText','DependentParentID','IsQuestionDependent','ErrorMessage','undefined','txtChoiceText','539e5d24-7d48-4bea-9587-6bae129c3e05')

Even though this function returning false form is being posted to the server in IE 8,7. but this is working fine in IE 9.  
0
Free Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

 
LVL 17

Expert Comment

by:OmniUnlimited
ID: 36707729
Can you just try:
 
onsubmit="return CheckForOptions('QuestionText','DependentParentID','IsQuestionDependent','ErrorMessage','undefined','txtChoiceText','539e5d24-7d48-4bea-9587-6bae129c3e05');"

Open in new window

0
 
LVL 17

Expert Comment

by:OmniUnlimited
ID: 36707733
I am assumming you have this event on the <form> tag.
0
 
LVL 1

Author Comment

by:Praveen_Bobbili
ID: 36709479
No luck..............
0
 
LVL 17

Expert Comment

by:OmniUnlimited
ID: 36709614
What happens if you just do onsubmit="return false;"?
0
 
LVL 1

Author Comment

by:Praveen_Bobbili
ID: 36714588
Form is being submitted.............................if this function returns true then only  form needs to be submitted, but when it is returning false also form is being submitted..
0
 
LVL 17

Expert Comment

by:OmniUnlimited
ID: 36714610
You must have something wrong in your form.  Can you post the tag just as you have it (just the tag with all its attributes only.  I don't need to see the rest of the inputs.)
0
 
LVL 1

Author Comment

by:Praveen_Bobbili
ID: 36716989
<form id="SbtButton" onsubmit="javascript:return CheckForOptions('QuestionText','DependentParentID','IsQuestionDependent','ErrorMessage','true','txtChoiceText','186815b5-fc22-4559-b5ba-807fc5f77545')" action="/surveyQA/Survey/AddQuestion" method="post" jQuery1510335410809809651="3">
0
 
LVL 17

Expert Comment

by:OmniUnlimited
ID: 36720232
That jQuery1510335410809809651="3" attribute is not a normal attribute.  You must have other javascript working on this form.  Try disabling each of the javascripts that affect the form (with the exception of the CheckForOptions() function) and see if the problem persists.
0
 
LVL 1

Author Comment

by:Praveen_Bobbili
ID: 36813096
I have searched some forums regarding jQuery1510335410809809651="3", they have stated that this is hot fix given by jquery team Only for ie to solve some issue, this tag is not coming into picture when we are browsing using Firfox and etc.........

But this is working fine in IE 9. This is only issue with IE 8 and lower versions.
0
 
LVL 17

Accepted Solution

by:
OmniUnlimited earned 50 total points
ID: 36813170
Ok, I understand, but my point is that in order for that attribute to affect your tag at all, you must have javascript running.  I am stating that I believe that the only way for your form tag to fail in IE (or any browser for that matter) is that you have other javascript that is interfering with the normal operation of the form, because onsubmit="return false;" will stop form submission in all versions of IE.  If you don't believe me, set up a blank html page and with a simple form tag with onsubmit="return false;" and a submit button.

Try removing all <script> tags from your <head> section (except, perhaps, the one that has the CheckForOptions() function) and see if the form submits.
0
 
LVL 1

Author Comment

by:Praveen_Bobbili
ID: 36814635
Ok, i will work on that......... Any suggestion in between.
0
 
LVL 1

Author Closing Comment

by:Praveen_Bobbili
ID: 38786222
Partially success with your approach.
0

Featured Post

Announcing the Most Valuable Experts of 2016

MVEs are more concerned with the satisfaction of those they help than with the considerable points they can earn. They are the types of people you feel privileged to call colleagues. Join us in honoring this amazing group of Experts.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
What jquery slider is this site using:http://www.beip.be/pages/01136/Partners.en.php? 5 16
Time picker 4 471
java script collapsible 1 223
GridMvc Error mvc5 5 200
Read about why it is more lucrative for an IT company to participate in government projects.
In threads here at EE, each comment has a unique Identifier (ID). It is easy to get the full path for an ID via the right-click context menu. However, we often want to post a short link within a thread rather than the full link. This article shows a…
Two types of users will appreciate AOMEI Backupper Pro: 1 - Those with PCIe drives (and haven't found cloning software that works on them). 2 - Those who want a fast clone of their boot drive (no re-boots needed) and it can clone your drive wh…
Established in 1997, Technology Architects has become one of the most reputable technology solutions companies in the country. TA have been providing businesses with cost effective state-of-the-art solutions and unparalleled service that is designed…

828 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question