Client Side Validation

J

jack-e

Hi there,

I have a form with 3 textboxes, each with a server side validiation
control. When the form submits I am wanting to display a message like
'Processing request.. please wait.' so they don't click the button
again.

I thought I would do this with some javascript. When the user clicks
the button it calls a funtions to display the messge which is inside a
DIV. This works fine but if the page is invalid the message is still
displayed. Can I somehow validate the page client-side??
Code so far ->

Server Side:

SubmitImageButton.Attributes.Add("onclick", _
"internetSelect();")


Client-Side:

******************

<script type="text/javascript">
function internetSelect() {
document.getElementById("ProcessDiv").style.visibility =
"visible";
}
</script>

*******************
<** textboxes code ****>

<table>
<tr>
<td align="right"><asp:imagebutton id="SubmitImageButton"
ImageUrl="~/images/submit-button.jpg" "server"></asp:imagebutton>&nbsp;
</td>
<td align="left">
<div id="ProcessDiv" style="VISIBILITY: hidden">Processing request..
Please wait.. </div>
</td>
</tr>
</table>

******************

Thanks in advance!
 

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

Top