SitePoint Sponsor

User Tag List

Results 1 to 2 of 2
  1. #1
    SitePoint Member
    Join Date
    Jul 2002
    Posts
    13
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    calling a subprocedure

    i am coding for an online survey (in VBScript). on the click of the submit button, i wish for a function to be called which will check to see have all fields been filled out and if not, a message box to appear. here is a snippet of the code:
    ...survey....
    <%
    Sub Validate_onClick
    'ERROR CATCHING
    'question 2
    If (Request("People") <> "") AND (Request.Form("Specify") <> "") Then
    MsgBox "Please enter value for Q2"

    End if

    End Sub
    %>

    <INPUT TYPE=RESET name="btnAdd" value="Reset" onClick="return confirm('Are you sure you wish to reset?');"><INPUT TYPE="submit" name="btnAdd" value="Submit" onClick = "Validate()">

    however, the code is not working as the message box is not appearing...what am i doing wrong?
    thank you!

  2. #2
    Drupaler bronze trophy greg.harvey's Avatar
    Join Date
    Jul 2002
    Location
    London, UK
    Posts
    3,258
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)


    We've told you once (http://www.sitepointforums.com/showt...953#post557953) -- use JavaScript for this. Platinum even posted the code for you .....

    You can't call a VBS sub-procedure with JavaScript (which is what you're trying to do). You'd have to have a separate ASP script checking the data AFTER it was posted to do it that way using your VBS function.

    G


Bookmarks

Posting Permissions

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