javascript doesn't work

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Hello!

I have a .net form in an IE6 browser. I have a javascript validate function
that returns false if user hits cancel.

From testing, I can see when I click submit and cancel, the javascript is
returning the false code to the button correctly.

However, the asp page continues with execution and the code runs (which was
not supposed to in this instance!).

Is there an obvious explanation for this?

Thank you!

-Bahman
 
Can you post the actual 'onclick' event line in the control, from your code?

is it something like onclick='return javascriptFunction();'
 
Maybe I am not understanding .... but your situation seems similar to a
problem I eventually resolved. After great tears .... I eventually discovered
that Button objects FORCE a postback regardless of true or false returned. I
replaced all Buttons with Image controls, added an "OnClick" attribute to the
control and in the JavaScript I fire __doPostBack('',''); when I want to
complete the code, otherwise I return false.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top