Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 2 of 2
  1. #1
    New Coder
    Join Date
    Jul 2004
    Posts
    17
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Client side validation

    Hi Everyone,
    I have another question for you. I have a form with two dropdown list cbosupplier1 and cbosupplier2 and one textbox txtKeywords and a Go button btnsubmit. I would like to perform some client side validation before posting the results to the server. I though I could create a javascript function as follows

    function validate_user_input()
    {
    if(document.searchform.cbosupplier1.SelectedItem != 0 && document.searchform.cboSupplier2.SelectedItem !=0 !! document.searchform.txtKeywords != "")
    {
    return true;
    }//end of if
    else
    {
    return false
    }//end of else

    }//end of function


    so in the forms onsubmit event procedure i would call the validate user input function, but i also want to call another method in my asp.net code if and only if that function defined above evaluates to true

    so in my asp.net code I would create the search forms OnSubmit event procedure which will be called after the javascript function evaluates to true.
    Could someone help me describe how I would go around doing this??
    Thanks Bob.

  • #2
    Senior Coder angst's Avatar
    Join Date
    Apr 2004
    Location
    Toronto, Ontario
    Posts
    2,114
    Thanks
    15
    Thanked 122 Times in 122 Posts
    you should repost this in the Java Script (client side) forum section.


  •  

    Posting Permissions

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