How to bypass onsubmit event when post back DDL event?

Hello, friends, 

In the source code, there was a JavaScript function isValidInput() for form onsubmit event, i.e., onsubmit="return isValidInput()"

In VS2003, this function was not called when SelectedIndexChanged event in DropDownList boxes was fired.

In VS2008, this function was called when SelectedIndexChanged event in DropDownList boxes was fired.

In either case, DropDownList had property AutoPostBack="true". Therefore,

Before, when a user selected a different list index from DDL, it won't check validation. So, it worked. (It validated inputs only when a user clicked on Send button to submit this form).

Now, when a user selected a different list index from DDL, it WILL check validation. User can go nowhere since he/she need more data based on the selected item in DDL. So, now it does work.

If I get rid of isValidInput() function, events are fired as normal.

How to get around this? Any ideas? (This would be a nightmare if we had to rewrite it in VS.net 2008 since it is a pretty big app)

Thanks a lot for your help.

(Modified from Why SelectedIndexChanged event in DropDownList boxes not firing? )

-1
vbird2k
5/5/2009 12:17:31 AM
asp.net.web-forms 93655 articles. 3 followers. Follow

2 Replies
1838 Views

Similar Articles

[PageSpeed] 52

Do you have, or can you add, a Submit button to the form?  If so, you can move the isValidInput function to the onclientclick event of this button.  That might work for you.


C# <---> VB.Net Translator
-1
MetalAsp
5/5/2009 1:30:58 AM

MetalAsp.Net:

Do you have, or can you add, a Submit button to the form?  If so, you can move the isValidInput function to the onclientclick event of this button.  That might work for you.

Great! Thanks.

Do you know it works for other non-IE browsers?

-1
vbird2k
5/5/2009 1:52:26 AM
Reply:

Web resources about - How to bypass onsubmit event when post back DDL event? - asp.net.web-forms

Blog archive - Splinter Software
Chris Hulbert, Splinter Software, is a freelance iOS developer based in Sydney, Australia.

Action-Guy Comics - Mercenary Art Studio Store
Home Achilleas Kokkinakis Action-Guy Comics Amazing Family..Guy Avengers Assembwhaaa? Buttman The Dark Guy Falls Civil Wha…? Fantastic Family ...

公司网络web服务器负载均衡解决方案
数据库子站,提供数据库管理软件优质技术信息的领先在线资源,是数据库管理员、开发人员和负责决策制定的 IT 经理人至关重要的社区。我们提供具有特色的、全面的内容,包括专家答疑、讨论论坛、白皮书、原创的行业新闻、评论分析以及技术技巧等。还有众多国内外数据库专家定期为我们的网友在线答疑,让我们的沟通学习更为方便。 ...

Asana · Luna
Luna is an in-house end-to-end framework that automates the busy work of writing rich web applications to an unprecedented degree

Email this page to a friend - B&H Photo Video Pro Audio
$(".emailItemToFriend").validate({ onsubmit: true, onfocusout: false, onkeyup: false, rules: { sendersEmailAddress: { required: true, email: ...


Clicks Today February 2013 Archives » Clicks Today
ClicksToday.com You are currently browsing the Clicks Today blog archives for February, 2013. About February 2014 January 2014 December 2013 ...

Home - :
Fast & Easy CopyDoodles are easy to use for any business, no matter what your system set up is. Guaranteed to Work We have a huge collection ...

Javascript Tutorials, Examples, and Code Reference
Javascript tutorials for website scripting and programming. Here you can learn about Javascript, see examples, and also find out which technologies ...

Entrepreneur Stories - Be Your Own Boss
action="http://feedburner.google.com/fb/a/mailverify" method="post" target="popupwindow" onsubmit="window.open('http://feedburner.google.com ...

Resources last updated: 12/8/2015 3:20:41 AM