SitePoint Sponsor

User Tag List

Results 1 to 2 of 2
  1. #1
    Non-Member
    Join Date
    Jul 2008
    Posts
    221
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    asp form validation help

    Hello,



    I am try to create a search form and require a user to select

    1. Student and

    2. either a "alldates" checkbox or "Start" and "End" dates.



    This is what I did, but it never works for me.



    What did I do wrong? How do I modify this code to make it worked.



    Code:
    <form method=POST action="Student.asp" name="frmStudent" onSubmit="return checkForm();">
    
    <%       if not rsStudent.eof then %>
    
                            <select name="SelectStudent" size="1" title="Select a Student">
    
                                        <option value="1" SELECTED>Select a Student</option>
    
                                        <%       do until rsStudent.eof %>
    
                                        <option><%= rsStudent("Names") %></option>
    
                                        <%       rsStudent.MoveNext
    
                                                    loop    %>
    
                            </select>
    
                <%       end if
    
    %>
    
                All Dates:</span><input type="checkbox" Name="alldates" value="1"><br />
    
                <input name="Start" id="Start" class="" type="text" size="10" maxlength="12" onBlur="checkdate(this)" value=""><br />
    
                <a href="javascript:;" onclick="displayDatePicker('Start', this);"><img src="img/calendar.gif"></a>
    
                <input name="End" id="End" class="" type="text" size="10" maxlength="12" onBlur="checkdate(this)" value="">
    
                <a href="javascript:;" onclick="displayDatePicker('End', this);"><img src="img/calendar.gif"></a><br />
    
    <input type="Submit" name="btnSubmit" value="Search">
    
    </form>
    
     
    
    <!--Search.asp -->
    
    <%
    
    If Request("rsTraveler") = "1" Then
    
                errorForm "Please select a Student!"
    
    ElseIf (Request("alldates") = "") OR (Request("Start") = "" AND (Request("End")) = "" OR (Request("alldates") = "") Then
    
                errorForm "Please select a Date!"
    
    End If
    
    Else
    
    ---Show the results
    
    %>

  2. #2
    SitePoint Addict itHighway's Avatar
    Join Date
    Jan 2008
    Location
    GUJ
    Posts
    270
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    If you need help with form validation, please include javascript validation code as well.


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
  •