473,394 Members | 1,781 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,394 software developers and data experts.

Client Side Form Validation

Vi
I have a web form that is submitted using an <asp:Button> control.
On this form I want to do some client side validation using the onsubmit
event of the form (client side). In order to do that I'm trying to attach to
the Form the onsubmit attribute, so that the client side code looks like this:
<FORM NAME="oDoSubmit" onsubmit="return(myOnSubmitEventHandler());">
</FORM>
But I can't do that, because I don't know how to access the Form control in
the code behind.
Or maybe somebody has a better idea how to do client side validation on a
web form that uses an <asp:Button> control to submit the form.

Thank you
Vi.
Nov 18 '05 #1
1 1286
Add a custom validator then write your specific javascript function and
attach that function to the custom validator and attach the control to the
custom validator.

See examples here: http://www.codeproject.com/aspnet/aspnetvalidation.asp
"Vi" <Vi@discussions.microsoft.com> wrote in message
news:6D**********************************@microsof t.com...
I have a web form that is submitted using an <asp:Button> control.
On this form I want to do some client side validation using the onsubmit
event of the form (client side). In order to do that I'm trying to attach to the Form the onsubmit attribute, so that the client side code looks like this: <FORM NAME="oDoSubmit" onsubmit="return(myOnSubmitEventHandler());">
</FORM>
But I can't do that, because I don't know how to access the Form control in the code behind.
Or maybe somebody has a better idea how to do client side validation on a
web form that uses an <asp:Button> control to submit the form.

Thank you
Vi.

Nov 18 '05 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
by: Gareth | last post by:
Hi, I've just published a test web site on the internet with a simple form and some client side validation controls. On my development PC if I click submit without entering any data the validation...
2
by: Dnna | last post by:
I have a table which is bound to an Internet Explorer XML data island. I'm using ASP.NET's client-side validators for an input field in the table. The problem is that if the input fields are in...
14
by: Matt | last post by:
I want to know if ASP.NET Web Forms Validation Controls are Server-Side or Client-Side form validation? Since I think each validator control can select either 1) JavaScript based error dialog or 2)...
1
by: rmgalante | last post by:
I have written an ASP.Net application that uses the standard client-side and server-side validation for various fields on the form. Some of the customers that use the form report symptoms that...
1
by: vidya | last post by:
Hi, I have a button which is a web control. I have some validation in javascript for the button in .aspx file and some in the button onclick event in code behind(C#). I need to get through both...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.