
October 27th, 2003, 08:50 PM
|
|
Up To His Eyes In Ads
|
|
Join Date: Oct 2002
Location: Chicago
Posts: 160
Time spent in forums: 1 m 25 sec
Reputation Power: 8
|
|
Don't you have to call "Validate()"? Maybe you do somewhere else in your code...?
This is an excerpt from a posting on Google Groups that might help you with the client-side function...
Quote: Ok, you can do this using a CustomValidator.
1. Add a custom validator to you form.
2. Set the control to be validated.
3. In the ClientValidationFunction field enter the function name you want called
4.The function name will need to accept 2 parameters (source, arguments)
5. Within the function you can do anything you need to. To cancel the post "arguments.IsValid = false"
Example
<script language="javascript">
function MyScript(source, arguments){
//You can do anything you want in here.
//Using the window.event.srcElement.name you can determine what button or event caused you method to be called
arguments.IsValid = confirm("Event type = " + window.event.type + "\nEvent Source = " + window.event.srcElement.name);
//arguments.IsValid = false; Cancels the Post
//arguments.IsValid = true; Validation passes let form post
}
</script>
|
|