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

Rquired field validator - client side problem

RA
Hi

How do I disable it if the user pressed a button:
asp:imagebutton id="btnHome" onclick="test()" runat="server"

What I want to have is that if someone presses this button then the required
field validator won't be activated so the user can move out of the current
page.
Nov 17 '05 #1
4 2778
Hi,

First, you'll want an HTML button so that you can more easily add
client-side script to its click event. Then you will want to disable the
validation control by calling ValidatorEnable(RequiredFieldValidator,
false).

For more information, see
http://msdn.microsoft.com/library/de...us/dnaspp/html
/aspplusvalid.asp and search within it for the text ValidatorEnable. It
includes sample code.

I hope this helps.

Thank you, Mike
Microsoft, ASP.NET Support Professional

Microsoft highly recommends to all of our customers that they visit the
http://www.microsoft.com/protect site and perform the three straightforward
steps listed to improve your computer’s security.

This posting is provided "AS IS", with no warranties, and confers no rights.

--------------------
From: "RA" <ro****@hotmail.com>
Subject: Rquired field validator - client side problem
Date: Wed, 15 Oct 2003 13:31:58 -0500
Lines: 10
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 6.00.2800.1106
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1106
Message-ID: <e2**************@TK2MSFTNGP12.phx.gbl>
Newsgroups: microsoft.public.dotnet.framework.aspnet
NNTP-Posting-Host: dialup-67.27.136.33.dial1.minneapolis1.level3.net 67.27.136.33 Path: cpmsftngxa06.phx.gbl!TK2MSFTNGP08.phx.gbl!TK2MSFTN GP12.phx.gbl
Xref: cpmsftngxa06.phx.gbl microsoft.public.dotnet.framework.aspnet:184393
X-Tomcat-NG: microsoft.public.dotnet.framework.aspnet

Hi

How do I disable it if the user pressed a button:
asp:imagebutton id="btnHome" onclick="test()" runat="server"

What I want to have is that if someone presses this button then the required field validator won't be activated so the user can move out of the current
page.


Nov 17 '05 #2
RA
Yes but I have many asp buttons and if the user clickes any one of them I
would like to disable the validation. How do I add client side script to asp
buttons?
Thanks,
Ron

""Mike Moore [MSFT]"" <mi****@online.microsoft.com> wrote in message
news:Q2**************@cpmsftngxa06.phx.gbl...
Hi,

First, you'll want an HTML button so that you can more easily add
client-side script to its click event. Then you will want to disable the
validation control by calling ValidatorEnable(RequiredFieldValidator,
false).

For more information, see
http://msdn.microsoft.com/library/de...us/dnaspp/html /aspplusvalid.asp and search within it for the text ValidatorEnable. It
includes sample code.

I hope this helps.

Thank you, Mike
Microsoft, ASP.NET Support Professional

Microsoft highly recommends to all of our customers that they visit the
http://www.microsoft.com/protect site and perform the three straightforward steps listed to improve your computer's security.

This posting is provided "AS IS", with no warranties, and confers no rights.
--------------------
From: "RA" <ro****@hotmail.com>
Subject: Rquired field validator - client side problem
Date: Wed, 15 Oct 2003 13:31:58 -0500
Lines: 10
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 6.00.2800.1106
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1106
Message-ID: <e2**************@TK2MSFTNGP12.phx.gbl>
Newsgroups: microsoft.public.dotnet.framework.aspnet
NNTP-Posting-Host: dialup-67.27.136.33.dial1.minneapolis1.level3.net

67.27.136.33
Path: cpmsftngxa06.phx.gbl!TK2MSFTNGP08.phx.gbl!TK2MSFTN GP12.phx.gbl
Xref: cpmsftngxa06.phx.gbl microsoft.public.dotnet.framework.aspnet:184393 X-Tomcat-NG: microsoft.public.dotnet.framework.aspnet

Hi

How do I disable it if the user pressed a button:
asp:imagebutton id="btnHome" onclick="test()" runat="server"

What I want to have is that if someone presses this button then the

required
field validator won't be activated so the user can move out of the current page.

Nov 17 '05 #3
Hi,

That's a difficult subject. When you have asp buttons and validators on the
same page, the validators "take over" the button's click event and it's
tricky to get it back.

There are seven or so ways to get the click event back listed on this web
site, including sample code. Good luck.
http://authors.aspalliance.com/kenc/faq6.aspx

Thank you, Mike
Microsoft, ASP.NET Support Professional

Microsoft highly recommends to all of our customers that they visit the
http://www.microsoft.com/protect site and perform the three straightforward
steps listed to improve your computer’s security.

This posting is provided "AS IS", with no warranties, and confers no rights.
--------------------
From: "RA" <ro****@hotmail.com>
References: <e2**************@TK2MSFTNGP12.phx.gbl> <Q2**************@cpmsftngxa06.phx.gbl> Subject: Re: Rquired field validator - client side problem
Date: Wed, 15 Oct 2003 22:10:04 -0500
Lines: 70
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 6.00.2800.1106
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1106
Message-ID: <un**************@TK2MSFTNGP10.phx.gbl>
Newsgroups: microsoft.public.dotnet.framework.aspnet
NNTP-Posting-Host: dialup-67.24.71.97.dial1.minneapolis1.level3.net 67.24.71.97 Path: cpmsftngxa06.phx.gbl!TK2MSFTNGP08.phx.gbl!TK2MSFTN GP10.phx.gbl
Xref: cpmsftngxa06.phx.gbl microsoft.public.dotnet.framework.aspnet:184506
X-Tomcat-NG: microsoft.public.dotnet.framework.aspnet

Yes but I have many asp buttons and if the user clickes any one of them I
would like to disable the validation. How do I add client side script to asp buttons?
Thanks,
Ron

""Mike Moore [MSFT]"" <mi****@online.microsoft.com> wrote in message
news:Q2**************@cpmsftngxa06.phx.gbl...
Hi,

First, you'll want an HTML button so that you can more easily add
client-side script to its click event. Then you will want to disable the
validation control by calling ValidatorEnable(RequiredFieldValidator,
false).

For more information, see

http://msdn.microsoft.com/library/de...us/dnaspp/html
/aspplusvalid.asp and search within it for the text ValidatorEnable. It
includes sample code.

I hope this helps.

Thank you, Mike
Microsoft, ASP.NET Support Professional

Microsoft highly recommends to all of our customers that they visit the
http://www.microsoft.com/protect site and perform the three

straightforward
steps listed to improve your computer's security.

This posting is provided "AS IS", with no warranties, and confers no

rights.

--------------------
From: "RA" <ro****@hotmail.com>
Subject: Rquired field validator - client side problem
Date: Wed, 15 Oct 2003 13:31:58 -0500
Lines: 10
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 6.00.2800.1106
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1106
Message-ID: <e2**************@TK2MSFTNGP12.phx.gbl>
Newsgroups: microsoft.public.dotnet.framework.aspnet
NNTP-Posting-Host: dialup-67.27.136.33.dial1.minneapolis1.level3.net

67.27.136.33
Path: cpmsftngxa06.phx.gbl!TK2MSFTNGP08.phx.gbl!TK2MSFTN GP12.phx.gbl
Xref: cpmsftngxa06.phx.gbl microsoft.public.dotnet.framework.aspnet:184393 X-Tomcat-NG: microsoft.public.dotnet.framework.aspnet

Hi

How do I disable it if the user pressed a button:
asp:imagebutton id="btnHome" onclick="test()" runat="server"

What I want to have is that if someone presses this button then the

required
field validator won't be activated so the user can move out of the current page.



Nov 17 '05 #4
This is actually a very simple problem to over come. Add this property to your button >> CausesValidation=False . When you click the button no validation occurs and you can navigate elsewhere.
Jul 16 '06 #5

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

Similar topics

5
by: Do | last post by:
Hi, Has anybody run into problems with Page.IsValid? My errors show up when the fields aren't filled correctly, but my processing continues even if the page is invalid. I leave name and...
4
by: News | last post by:
Hi, I am new to asp.net and unfortunately, have to learn as I go. Here is a "problem". I have got two radio buttons No and Yes and text box that has to be fiiled in only if Yes is clicked. How...
6
by: Paul | last post by:
I am trying to setup a field validator and tried using the control to validate set to a dropdown list box but did not seem to work. Is there anyway to set this up or do you need to use client side...
2
by: z. f. | last post by:
Hi, i have a field with required field validator. on the client side it's working. when i submit without the required field the page gets back because of not valid, but the message from the...
6
by: hansiman | last post by:
I'm having trouble getting the required field validator to work. I can still save the row in the datagrid... I can't see what I'm doing wrong. <asp:TemplateColumn SortExpression="c.Password"...
3
by: VB Programmer | last post by:
Can you make a required field validator optional? I know it sounds crazy, but.... Let's say I have a signup form. It consists of 2 sections. The top section is a "GOLD MEMBER" section. It...
3
by: Kivak Wolf | last post by:
Hi, Could someone give me a quick review of how to use the required field Validator? I'm completely at a loss, and MSDN does not help one bit. =/ Basically all I want done is to make sure that...
12
by: Vadim | last post by:
Hi! I am looking for HTML validator with the following restrictions: 1. Web server is the localhost (page should be validated locally). 2. The page is dynamic (generated by PHP with client side...
1
by: onseats.ky | last post by:
I have a strange problem with a required field validator when I have EnableClientScript set to true. When the client side validation fires I get a javascript exception inside the .net javascript....
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
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...

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.