D
Dan Christensen
Hi, I've got my own validation javascript for a form, which works
great.
I add it into the processing loop with
btn.OnClientClick = "if (!form_onsubmit(this)) return false;";
form_onsubmit is my custom validation function which disables the
button, validates my fields, and returns true if valid, false
otherwise.
The if() wrapping trick was found on a blog, and was necessary because
returning true simply posted back the form, not using
WebForm_DoPostBackWithOptions() to preserve the __EVENTTARGET and
friends, which would allow the page to fire the btn's click event
before the Response went to the client.
However, after the if statement fails (form_onsubmit returns true, no
else case, so things fall through), the postback happens, but
Page.IsPostBack is false, and the btn.Click events never fire.
Anything I'm doing obviously wrong? It seems as though the
WebForm_DoPostBackWithOptions() stuff should be happening due to the
falling through ...
Thanks,
Dan
great.
I add it into the processing loop with
btn.OnClientClick = "if (!form_onsubmit(this)) return false;";
form_onsubmit is my custom validation function which disables the
button, validates my fields, and returns true if valid, false
otherwise.
The if() wrapping trick was found on a blog, and was necessary because
returning true simply posted back the form, not using
WebForm_DoPostBackWithOptions() to preserve the __EVENTTARGET and
friends, which would allow the page to fire the btn's click event
before the Response went to the client.
However, after the if statement fails (form_onsubmit returns true, no
else case, so things fall through), the postback happens, but
Page.IsPostBack is false, and the btn.Click events never fire.
Anything I'm doing obviously wrong? It seems as though the
WebForm_DoPostBackWithOptions() stuff should be happening due to the
falling through ...
Thanks,
Dan