Form Validation and submission

Results 1 to 3 of 3

Thread: Form Validation and submission

  1. #1
    Join Date
    Dec 1969

    Default Form Validation and submission

    I have used RequiredFieldValidator to make sure the user enters all the information. I have defined a function for the onClick event of the button. In this function I am doing the tasks of writing the information to the database. Now the issue I am coming across is:<BR><BR>1. The event is fired even if the validation fails.<BR>2. If I add &#039;CausesValidation=true&#039; to the button tag and check the Page.IsValid property in the function that writes to the db the property returns false.<BR><BR>How can I make sure that the form is valid before writing the contents to the database

  2. #2
    Join Date
    Dec 1969

    Default possible mistakes..

    -check if you tied the validator with the textfield in the controlToValidate property(sometimes you forget !)<BR><BR>-enable Client script( i don&#039;t think its required ...but highly recommended)<BR><BR>- if(IsValid) block must exist...i c u have it !! this is strange.<BR><BR>this is what i got, hope i helped

  3. #3

    Default RE: Form Validation and submission

    Client side validation is optional, you need to check Page.IsValid before you do anything in the click event.<BR>

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts