asp .net form...

M

mike

Hello everyone,

I have a server side asp .net form that has two peices of
information that can be updated by one of two submit
buttons. one submit button updates one database table
with the top half of the form. On the bottom half of the
form I have other infomation that can be instered or
updated to another table in the database by a second
submit button. Every thing was working fine until I added
feild validators to both peices of information. So now my
problem is that when I try to submit the top half of the
information, it wants to validate the bottom half of the
information at the same time. Is there any way to tell
either a submit button to disregard some field validators
or be able to tell the field validators not to fire when
a particular submit button is fired?

I thought about putting the bottom information in its own
server side form, but apparently you can only have one
server side form per page.

Any help or suggestions would be greatly appreciated.

Thanks,
mike
 
A

anastasia

Field Validation occurs on the client, as you know. When you set the
Submit button's CausesValidation to TRUE in server side code, ASP will
the write the following client onclick event in your submit button
element:

onclick="if (typeof(Page_ClientValidate) == 'function')
Page_ClientValidate(); ".

Page_ClientValidate is a function that is located in the
WebUiValidation.js file (do a file search on this page).

Get acquainted with the valiation code. You can step through it by
debuggin your app on the client and open the "running documents"
window...when your page loads it will display all the included
documents on your page. Then, you can step through the validation
process when you click "onsubmit".

You will probably see that there are probably a number of ways you
could manipulate this. Of course, don't change the webuivalidation.js
file..that could be trouble ;-)

You could do lots of things here...Maybe set CauseValidation to false
on the Submit button and then MANUALLY add the onclick event code in
your server side code (I haven't tried this, so I am not sure what
sort of little problems could crop up - HOWEVER it can be done). You
could, in your HTML, add some kind of property or divider in order to
determine which controls to validation when. I don't know your code,
so I can't advise how to do this..it could require a bit of work...

Stacey

You could possibly
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
474,079
Messages
2,570,574
Members
47,206
Latest member
Zenden

Latest Threads

Top