473,382 Members | 1,692 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,382 software developers and data experts.

Java Script Validation

hoz
Hi ,
I am developing an web application . I have a form for user login ,contains
two textboxs . How can i check them if these are empty using client side
validation ?
But i want it like below
<script lang="..... >
function Validate()
{ if ( this.forms.userTxt=="")
return false ;
....
}
</script>

the button is server side , how can i add , when clicked first goto Validate
and then execute button_click() ?
Nov 19 '05 #1
3 1082
Button.Attributes.Add ("onClick", "return Validate();")

Your Validate() function should return true if postback should occur, false
to stay.

Another option is to use the RequiredFieldValidator control (one for each
text box).

"hoz" <as*@me.com> wrote in message
news:uM*************@TK2MSFTNGP09.phx.gbl...
Hi ,
I am developing an web application . I have a form for user login ,contains
two textboxs . How can i check them if these are empty using client side
validation ?
But i want it like below
<script lang="..... >
function Validate()
{ if ( this.forms.userTxt=="")
return false ;
....
}
</script>

the button is server side , how can i add , when clicked first goto Validate
and then execute button_click() ?

Nov 19 '05 #2
hoz
Thanks very much

"Shiva" <sh******@online.excite.com> wrote in message
news:ul**************@TK2MSFTNGP09.phx.gbl...
Button.Attributes.Add ("onClick", "return Validate();")

Your Validate() function should return true if postback should occur, false to stay.

Another option is to use the RequiredFieldValidator control (one for each
text box).

"hoz" <as*@me.com> wrote in message
news:uM*************@TK2MSFTNGP09.phx.gbl...
Hi ,
I am developing an web application . I have a form for user login ,contains two textboxs . How can i check them if these are empty using client side
validation ?
But i want it like below
<script lang="..... >
function Validate()
{ if ( this.forms.userTxt=="")
return false ;
...
}
</script>

the button is server side , how can i add , when clicked first goto Validate and then execute button_click() ?

Nov 19 '05 #3
Hello hoz,

Look at the asp:RequiredFieldValidator control. This handles everything for
you. You dont need to write any javascript.

--
Matt Berther
http://www.mattberther.com
Hi ,
I am developing an web application . I have a form for user login
,contains
two textboxs . How can i check them if these are empty using client
side
validation ?
But i want it like below
<script lang="..... >
function Validate()
{ if ( this.forms.userTxt=="")
return false ;
....
}
</script>
the button is server side , how can i add , when clicked first goto
Validate and then execute button_click() ?

Nov 19 '05 #4

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

Similar topics

0
by: Brian | last post by:
I am having alot of trouble getting a XML document validated with a schema. I got a sample document and schema off of w3schools.com, which passed an online xml validator:...
7
by: drum118 | last post by:
What is the current way for stating what a java script TITLE is for xhtml strict since I must be over looking it? W3 validation said there is no title. When I wrote the site 5 years ago to...
23
by: Loony | last post by:
I have got a code like this in HTML section in ASP file which includes javascript file! The script works under MS IE but doesn't with Firefox! Can anybody tell me what is wrong? <HTML>...
2
by: Jobs | last post by:
Download the JAVA , .NET and SQL Server interview with answers Download the JAVA , .NET and SQL Server interview sheet and rate yourself. This will help you judge yourself are you really worth of...
4
by: Francois Stander | last post by:
Hi, hope someone can help me. It seems imposible to read data from a server, however, I can read the validation data from the server and hold it in dataviews . datasets or data tables in my asp...
1
sanjay123456
by: sanjay123456 | last post by:
SIr i want to learn validation in java script which r using on client side plz provide me some guidelines sanjay
4
by: Thiyagusathya | last post by:
Hi., Please help me for java script validation for text and numeric field.
1
by: jaimemartin | last post by:
hello, I want to validate an xml by means of a schema (xsd). To do that first of all I´m using a SchemaFactory. The problem is that if I run the code in Windows all works fine, but If I run it in...
2
by: poornimanithya76 | last post by:
Hi, I am having grid view an my page which is having template fields(text box, check box and drop down).If user clicks on check box i need to consider text box and drop down as a required fields.i...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
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
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
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...

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.