Question

I am trying to write a simple HTML form using asp.net and Jquery UI but am running into a problem when trying to process click event handlers on a button within this form. I was tryign to use OnClientClick and OnClick but once the clientside method gets accessed and returns the boolean the server side method is not called accordingly( not called at all actually) Linky to code since I could not get the code tags to work properly: http://pastebin.com/LZNMqASt

Was it helpful?

Solution 2

For some reason the return type of the javascript method was not being accepted as a valid boolean. The below solution fixes the OnClientClick event

<asp:Button runat="server" ID="btnLogin" Text="Login" OnClick="btnLogin_OnClick"
                    OnClientClick="if(ValidateLoginForm() != true) return(false);" UseSubmitBehavior="False" />

OTHER TIPS

I found the problem, Actually you are displaying "div#loginForm" element in to the dialog and its not taking the form element.

Put form element inside of "div#loginForm" container and the problem will be fixed.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top