472,371 Members | 1,575 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

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

Please help: Validating input from a combination of controls

Hi,

I'm developing a search facility for my web app. In order for the
search criteria to be valid the user must (a) enter some text in a
text box and check and least one checkbox (of which there are two)
and/or (b) select at least one item from a multiple select list box.
I've written the javascript to do the client side validation which
gets called on the click event of my search button. I'd like to
implement server side validation using the validation controls but am
not sure how to achieve this. Can the custom validation control be
used in this instance (i.e. to validate the input from multiple
controls). If so how?

Thanks,

Paul
Nov 18 '05 #1
1 1430
Yes, a CustomValidator can be built to describe the same logic on the server
side as on the client side. The trick is to avoid having it valid except
when this particular button is pressed. In this case, I'd avoid using the
Page.Validate() method which is automically called when the submit button's
CausesValidation = true. Instead, I'd hook up that button's Click event
handler and have it call Validate() on the CustomValidator. Set the button's
CausesValidation to false. If CustomValidator.IsValid is false, regenerate
the page without saving data.

This scenerio is a very common one that requires something called
"Validation Groups". ASP.NET 2.0 (Whidbey) will eventually have this
feature. In the meantime, I offer a commercial product that supports
Validation Groups and building the extensive logical case you describe
without coding. In fact, with my validators, it will generate the correct
JavaScript for you and it will work on IE, IE/Mac, Netscape 6+, Mozilla,
Opera 7 and Safari (whereas Microsoft's client-side validation is IE
specific.) My product is "Professional Validation And More". Learn more at
http://www.peterblum.com/vam/home.aspx.

--- Peter Blum
www.PeterBlum.com
Email: PL****@PeterBlum.com

"Paul" <pa********@hotmail.com> wrote in message
news:ca**************************@posting.google.c om...
Hi,

I'm developing a search facility for my web app. In order for the
search criteria to be valid the user must (a) enter some text in a
text box and check and least one checkbox (of which there are two)
and/or (b) select at least one item from a multiple select list box.
I've written the javascript to do the client side validation which
gets called on the click event of my search button. I'd like to
implement server side validation using the validation controls but am
not sure how to achieve this. Can the custom validation control be
used in this instance (i.e. to validate the input from multiple
controls). If so how?

Thanks,

Paul

Nov 18 '05 #2

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

Similar topics

20
by: titi | last post by:
Question The road and traffic authority for a small country currently uses a system to store information about all 'currently' licensed drivers. A licensed driver has the following info stored...
7
by: x muzuo | last post by:
Hi guys, I have got a prob of javascript form validation which just doesnt work with my ASP code. Can any one help me out please. Here is the code: {////<<head> <title>IIBO Submit Page</title>...
3
by: Default | last post by:
Hi, The problem is laughably simple: I have a text box which must accept only numbers (on aim to restrict some extremely "talented" users to write, for example "blahblahblah" instead of 234); In...
0
by: ani | last post by:
I have a datalist control in my aspx page(this is paginated and everytime submits to itself). I am calling a function within my datalist that returns a html control (radio button ) in the form of...
2
by: Osmosis | last post by:
I have a form with several controls, which all have their validating and validated events in my code. However, if these controls don't get focus, these events don't get called. When my OK...
2
by: Chris Dunaway | last post by:
I have a form with a textbox and numerous panels, buttons and other controls. I have handled the textbox Validating and Validated events. The textbox will hold a filename. In the validating...
0
by: Matthew | last post by:
All, I have searched google and the newsgroups but can't find anything the same as what I am experiencing (though I may have missed something). I have controls (textboxes) within UserControls...
0
by: Gary Shell | last post by:
I am experiencing some strange behavior between a UserControl's validating event and a treeview control. Initially, I thought it was related to an issue in the Knowledgebase article 810852...
7
by: Bruce HS | last post by:
I'd like to call my ancestor Validation Function every time any control on a Win Form generates a Validating or Validated event. I'm using VB. I've extended Textbox, for instance, to have its...
0
by: Naresh1 | last post by:
What is WebLogic Admin Training? WebLogic Admin Training is a specialized program designed to equip individuals with the skills and knowledge required to effectively administer and manage Oracle...
0
by: antdb | last post by:
Ⅰ. Advantage of AntDB: hyper-convergence + streaming processing engine In the overall architecture, a new "hyper-convergence" concept was proposed, which integrated multiple engines and...
0
hi
by: WisdomUfot | last post by:
It's an interesting question you've got about how Gmail hides the HTTP referrer when a link in an email is clicked. While I don't have the specific technical details, Gmail likely implements measures...
1
by: Matthew3360 | last post by:
Hi, I have been trying to connect to a local host using php curl. But I am finding it hard to do this. I am doing the curl get request from my web server and have made sure to enable curl. I get a...
0
Oralloy
by: Oralloy | last post by:
Hello Folks, I am trying to hook up a CPU which I designed using SystemC to I/O pins on an FPGA. My problem (spelled failure) is with the synthesis of my design into a bitstream, not the C++...
0
BLUEPANDA
by: BLUEPANDA | last post by:
At BluePanda Dev, we're passionate about building high-quality software and sharing our knowledge with the community. That's why we've created a SaaS starter kit that's not only easy to use but also...
0
by: Rahul1995seven | last post by:
Introduction: In the realm of programming languages, Python has emerged as a powerhouse. With its simplicity, versatility, and robustness, Python has gained popularity among beginners and experts...
2
by: Ricardo de Mila | last post by:
Dear people, good afternoon... I have a form in msAccess with lots of controls and a specific routine must be triggered if the mouse_down event happens in any control. Than I need to discover what...
1
by: ezappsrUS | last post by:
Hi, I wonder if someone knows where I am going wrong below. I have a continuous form and two labels where only one would be visible depending on the checkbox being checked or not. Below is the...

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.