473,951 Members | 32,234 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

CustomValidatio n

SAI
Should I bind one of the controls to the CustomValidatio n Object? e.g. bind
text box to it. In some cases, I may need to check 2 web object contents.
How to do it in one CustomValidatio n Object?

I tried to bind a text box to CustomValidatio n Object and set the Client
Validation to TRUE. Then I write a javascript to validate. It is no any
action about the checking. Any suggestion? thanks.
Nov 19 '05 #1
1 1500
You don't bind controls to validators...if you mean use the
"ControlToValid ate" you can leave it blank in the case of custom
validator....in custom validator on the client side, you need to get a
reference to the control yourself:

function Validate(src, args)
{
var txt = document.getEle mentById("myTex tbox");
if (txt.value == "")
{
args.IsValid = false;
}
}

--
MY ASP.Net tutorials
http://www.openmymind.net/ - New and Improved (yes, the popup is
annoying)
http://www.openmymind.net/faq.aspx - unofficial newsgroup FAQ (more to
come!)
"SAI" <te**@test.co m> wrote in message
news:u4******** ******@tk2msftn gp13.phx.gbl...
Should I bind one of the controls to the CustomValidatio n Object? e.g.
bind text box to it. In some cases, I may need to check 2 web object
contents. How to do it in one CustomValidatio n Object?

I tried to bind a text box to CustomValidatio n Object and set the Client
Validation to TRUE. Then I write a javascript to validate. It is no any
action about the checking. Any suggestion? thanks.

Nov 19 '05 #2

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

Similar topics

1
1760
by: philipl | last post by:
hi, i have a datagrid which display custom controls when user clicks edit, changing data. I am using customvalidator to validate this control. I can get validation of user input to work no problem when user clicks on update in datagrid. My problem is that when I try to get customvalidation to work when user changes the value in the control, as i want this to be checked as soon as user changes the control. The custom control offers an
2
1220
by: rodchar | last post by:
hey all, I'm not sure if this is even possible but here goes: if i put a CustomValidator control in my EditItem template column how do i get to it? Or how and where do i write my custom code for the customvalidation control? thanks, rodchar
2
2947
by: kpg | last post by:
Hi all, This should be simple... I have a TextBox1 and a customvalidation control linked to it. I use a client side script to validate the textbox. If the data is not valid I want to return focus to the textbox. I tried document.GetElementByID("TextBox1").focus(); and doucment.Form1.TextBox1.focus(); to no avail.
1
1272
by: zlusca | last post by:
Hi, guys I have asp.net form contain several textbox controls and one field is userName I want to validate this field to make sure there is no other user have the same userName before saving. so I create a customValidator to do that. The strange thing is that customValidator never fired the validation event. Here is the code: in aspx file the control is:
5
4166
by: gane kol | last post by:
Hi I have a set of Yes/No radio buttons with textboxes for each. I need to write a common customvalidation function that checks, if radiobutton "yes" is selected, the value in the corresponding textbox should be greater than 0. For eg: IsVM Qty: <radX0Yes> YES <radX0No> NO Qty: <txt00> IsVM1 Qty: <radX1Yes> YES <radX1Yes> NO Qty: <txt11>
0
920
by: sarithap | last post by:
Hi, I am working on Datagrids and am running into an issue. In my Datagrid I have a template column which has 10 text boxes in it. And I need to make sure that atleast one of the text boxes in that column has to be nonempty and show which row/rows has all these textboxes empty. How can I do this? I would really appreciate any solutions or suggestions to my problem.
1
1324
by: =?Utf-8?B?Ym9iYnk=?= | last post by:
I have a drop down list in my asp page. when I selectg an irem and click on a button it appears in the Grid view. But when I again come to the same page and click on the same item from Drop down list it and click on button it again add the same item onin the Grid view. So I need some validatiobn that if this item appears in Grid view Don't add in the Grid view. I can use customValidation contro. But I don't know how to use it.
1
1409
by: Craig Buchanan | last post by:
I have a Web User Control (.ascx file) that I need to valid using a CustomValidation control. Moreover, I would like use client and server validation, if possible. I have the logic for the server-side validation working correctly. I also have the have the client-side validation working once the control is embedded in a page. I would like to move the validation from the aspx page to the ascx page, but I'm concerned that the...
2
1735
JustRun
by: JustRun | last post by:
Hi, I'm developing a web application using ASP.NET2.0 with C#, I have tried to use custom validation controls to validate my forms, it worked very well in the English language , but when i test it with Arabic it didn't cause the validator consider the Arabic characters as Special Characters (. - ' " ...) which i prevent them in my forms. Is there any idea to make the validation control work with both, English and any other Unicode Language...
0
9998
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
11608
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. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
11207
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
11379
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 most users, this new feature is actually very convenient. If you want to control the update process,...
0
9914
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 launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
7450
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 into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
6238
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 the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
6362
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
2
4559
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.