473,568 Members | 2,850 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

IMP:ValidationS ummary/CustomValidator/ResetBtn

SMG
Hi All.
My forms has two textboxes, 1 username, 2 password.
Both has requiredfield validator it works fine when there is no input in
these textboxes.
And the errorMsg is shown in ValidationSumma ry.

Now I want to check the username should contain only chatacters,
( I want to use customvalidator ), when i enter char+number it trap the event
of customvalidator but it doesn't show the errormsg in the customValidator
and submits the form.

=============== ========
The Customvalidator & ValidationSumma ry code is as follows :
=============== ========
<asp:CustomVali dator id="valCust" ErrorMessage="P lease Enter Proper User
Name" ControlToValida te="txtUserName " Runat="server"> </asp:CustomValid ator>

<asp:Validation Summary Runat="server" ID="valValSumm " Height="31px"
Width="281px"></asp:ValidationS ummary>

=============== ========
The javascript function is as follows
=============== ========
function PropUserName(so urce, argument) {
var ValidChars = "abcdefghijklmn opqrstuvwxyz";
var Char; var sText=document. getElementById( "txtUserName"). value;
for (i = 0; i < sText.length; i++)
{
Char = sText.charAt(i) ;
if (ValidChars.ind exOf(Char) == -1)
{
arguments.IsVal id = false;
// alert("Please Enter Proper Name")
return;
}
} return;
}
=============== =====

It gives the alert from the javascript function, but it doesn't show the
ErrorMsgs associated with CustomValidator ??????

Can anyone tell me where I am wrong?

One more how do i reset the form values ?
Is there any other way than this "<input type=reset value=reset>" will my
error msgs will disappear with this? if not then how do i reset the form
values and disable the errormsgs in validationSumma ry.
regards,
SMG
Nov 18 '05 #1
1 1815
"SMG" <sh************ *@idealake.com> wrote in message
news:uh******** ******@tk2msftn gp13.phx.gbl...
Hi All.
My forms has two textboxes, 1 username, 2 password.
Both has requiredfield validator it works fine when there is no input in
these textboxes.
And the errorMsg is shown in ValidationSumma ry.

Now I want to check the username should contain only chatacters,
( I want to use customvalidator ), when i enter char+number it trap the event of customvalidator but it doesn't show the errormsg in the customValidator
and submits the form.

=============== ========
The Customvalidator & ValidationSumma ry code is as follows :
=============== ========
<asp:CustomVali dator id="valCust" ErrorMessage="P lease Enter Proper User
Name" ControlToValida te="txtUserName " Runat="server"> </asp:CustomValid ator>
<asp:Validation Summary Runat="server" ID="valValSumm " Height="31px"
Width="281px"></asp:ValidationS ummary>


You do not reference your JavaScript function in your CustomValidator tag.

Take a look at ASP.NET Validation in Depth
(http://msdn.microsoft.com/library/de...-us/dnaspp/htm
l/aspplusvalid.as p) from MSDN.
--
John Saunders
johnwsaundersii i at hotmail
Nov 18 '05 #2

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

Similar topics

7
2166
by: jcpmeticulus | last post by:
Hi I've spent the last day or so debugging a problem with a CustomValidator and am now totally stumped! Basically I use a number of CustomValidator's on my page, but have cut this down now to only 2. When the page is first loaded the CustomValidator are made and the generated HTML contains both of them. When the "Apply" button is clicked...
1
2013
by: bill yeager | last post by:
I'm using the customvalidator in my web page. I get the following error when I try to run the web page: Unable to find control id 'lstRider' referenced by the 'ControlToValidate' property of 'cvRiders'. Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more...
2
2402
by: Stephen Miller | last post by:
Can the CustomValidator be used to simply report unexpected errors, without requiring Client/Server validation? To explain, say you had a simple text box and button that did a Full-text Search of a Catalogue in SQL. Malformed search requests can generate a variety of errors, which I simply want to catch, set the CustomValidator's IsValid...
3
1747
by: Ronan Dodworth | last post by:
Hi there I'm having a little bit of a problem with my customvalidator control. The problem is the javascript runs fine on my local webserver IIS but not when I post it to the web hosting server. As it is client side scripting I'm suprised that this is the case as I'm using the same browser IE6 and the same machine to access both. I've...
3
1848
by: philipl | last post by:
hi, i have a textbox in my edititemtemplate in my datagrid. I have created a customvalidator for it, when i update the row the appropiate function gets called to customvalidate but the problem is that the error message in my customvalidator does not get printed in the datagrid even though I have set the isvalid property in the server...
0
3530
by: ghafranabbas | last post by:
This is how you use the customvalidator control in any INamingContainer interface control (Datagrid, DataList, DataRepeater, etc). 1. In the ItemTemplate, place your customvalidator 2. Set the OnServerValidate property of the customvalidator 3. Get reference to the Data Item object (For DataList is DataListItem, for DataGrid its...
1
2481
by: Beffmans | last post by:
Hi I have defined an customvalidator on my TextBox: function clientvalidate(source, arguments){ { // even number? if (arguments.Value%2 == 0) arguments.IsValid = true; else
1
1351
by: David | last post by:
I need help with CustomValidator in 1.1. I added the CustomValidator control and code as per the doc., (See below) However, the code is never executed. Is there an extra switch or setting to force the OnServerValidate code to execute? <asp:CustomValidator id="CustomValidator1" runat="server" ErrorMessage="CustomValidator"...
2
1955
by: Jeff | last post by:
hey net 3.5 I have problem with a customvalidator. I enter values into the TextBox named "txt" and clicks on the save button (ibSave) then the TestValidate method get triggered. TestValidate set args.IsValid = false and the customvalidator displays an error on the webpage. The problem is that when I check in the database, the value has...
0
7693
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main...
0
7916
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. ...
1
7660
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For...
0
7962
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 protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the...
0
6275
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then...
0
5217
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert...
0
3651
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in...
0
3631
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
932
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating...

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.