troubleshooting Question

Radio button

Avatar of djb80
djb80 asked on
Web Servers
3 Comments1 Solution266 ViewsLast Modified:
I have three form that build a page in fusebox.
There is a search form on the top, the main body of the page and a search form on the bottom.

In the search form on the bottom there are three radio button so you can choose how to search.  The problem is when one is clicked the form goes back to the top of the page instead of staying where it is and flipping from date to ticket to ticket/date search. The page reloads which is the way I wrote it but I was wondering how I could do it so this didn't happen.  


<cfform id="search_select" name="search_select" action="#request.myself#records.recordAppt" method="post">



<table align="left">

<tr >
<td ><cfinput type ="radio" name = "search" checked = "#datechecked#" value = "date" onClick="javascript:document.search_select.submit();"> Date <!--- onclick="<Body ONLOAD="searchbydate return true;"></body>"---->

</td>
</tr>
<tr >

</tr><p>&nbsp;</p><tr ><td ><cfinput type ="radio" name = "search" checked = "#ticketchecked#" value = "ticket" onClick="javascript:document.search_select.submit();" >Ticket Number
</td>
</tr>
<tr >
<td><cfinput type ="radio" name = "search" checked = "#dateticketchecked#" value = "dateticket" onClick="javascript:document.search_select.submit();" >Date and Ticket Number
</td>

</cfform>
</table>

<br>
<br>
<br>

<cfif #form.search# is "date">

<cfform name = "srchbydate" action="#request.myself#records.recordIncompAppt">
<table border="0" width="90%" >

<cfoutput><b><font size="-1">Search for Tickets:</font></b></cfoutput>

<tr>
<!---Put this is CSS sheet for directions font--->
     
          </p>
         
             
               
       
                  <div align="center">
                <center>
     
                      <table border="0" cellpadding="2" style="border-collapse: collapse" bordercolor="#111111" width="65" id="AutoNumber2" align="center">
               
                          <tr>
           
           <td>Enter Date</td>
            <td><cf_ct_date_input name="fdate" title = "Enter Date" size="11" required = "Yes" value = "#DateFormat(TodaysDate,"MM/DD/YYYY")#" style="text-align: center">
            </td>      
            
            
            
  <!---Defaults to today's date--->

                     <td><cfinput type="submit" style="color:#004080#; font-family:Arial; font-size:8pt" value="Search" name="B1">
                      </td>
                                
                               <td><cfinput type="reset" style="color:#004080#; font-size:8pt; font-family:Arial" value="Reset" name="B2">
            </td>    
                        
                                </tr>
                    <tr>
                      <td width="100%"><p align="center"></td>
                    </tr>
                  </table>
                </center>
              </div>
              <cfinput type="hidden" name="soption" value="1">
         
      </tr>
    </table>
  </center>
</div>
<br>

</cfform>

</cfif>

<cfif #form.search# is "ticket">
<cfform name = "srchbytick2" action="#request.myself#records.recordIncompAppt">

<table border="0" width="90%" >
<cfoutput><b><font size="-1">Search for Tickets:</font></b></cfoutput>


<tr>
<!---Put this is CSS sheet for directions font--->
     
          </p>
         
             
               
       
                  <div align="center">
                <center>
     
                      <table border="0" cellpadding="2" style="border-collapse: collapse" bordercolor="#111111" width="65" id="AutoNumber2" align="center">
               
                          <tr>
           
           <td>Enter Ticket</td>
                        <td><cfinput NAME="tnum" size="11" maxlength="8" title="Enter Ticket Number" style="text-align: center" >

            </td>      
            
            
            
  <!---Defaults to today's date--->

                     <td><cfinput type="submit" style="color:#004080#; font-family:Arial; font-size:8pt" value="Search" name="B1">
                      </td>
                                
                               <td><cfinput type="reset" style="color:#004080#; font-size:8pt; font-family:Arial" value="Reset" name="B2">
            </td>    
                        
                                </tr>
                    <tr>
                      <td width="100%"><p align="center"></td>
                    </tr>
                  </table>
                </center>
              </div>
              <cfinput type="hidden" name="soption" value="1">
         
      </tr>
    </table>
  </center>
</div>
<br>




 

</cfform>
</cfif>


<cfif #form.search# is "dateticket">
<cfform name = "srchbyboth2" action="#request.myself#records.recordIncompAppt">


<table border="0" width="90%" >
<cfoutput><b><font size="-1">Search for Tickets:</font></b></cfoutput>


<tr>
<!---Put this is CSS sheet for directions font--->
     
          </p>
         
             
                <cfform method="POST" name="cpnform" >
       
                  <div align="center">
                <center>
     
                      <table border="0" cellpadding="2" style="border-collapse: collapse" bordercolor="#111111" width="65" id="AutoNumber2" align="center">
               
                          <tr>
         <tr>  
           <td>Enter Date&nbsp;&nbsp;</td>
            <td><cf_ct_date_input name="xdate" title="Enter Date"size="11" required = "Yes" value = "#DateFormat(TodaysDate,"MM/DD/YYYY")#" style="text-align: center">
            </td>      
            </tr>
            <tr>
            <td>Enter Ticket</td>
                        <td>
            <cfinput NAME="tnum" size="11" maxlength="8" title="Enter Ticket Number" style="text-align: center" >
                  </td>
                         
                          <td>
                                                <cfinput type="submit" style="color:#004080#; font-size:8pt; font-family:Arial" value="Search" name="B1">
                   </td>
            
            
  <!---Defaults to today's date--->

                   
                                
                               <td><cfinput type="reset" style="color:#004080#; font-size:8pt; font-family:Arial" value="Reset" name="B2">
            </td>    
                        
                                </tr>
                    <tr>
                      <td width="100%"><p align="center"></td>
                    </tr>
                  </table>
                </center>
              </div>
              <cfinput type="hidden" name="soption" value="1">
          </cfform></td>
      </tr>
    </table>
  </center>
</div>
<br>



</cfform>
</cfif>
<br>
<br>
<br>
</body>
Join the community to see this answer!
Join our exclusive community to see this answer & millions of others.
Unlock 1 Answer and 3 Comments.
Join the Community
Learn from the best

Network and collaborate with thousands of CTOs, CISOs, and IT Pros rooting for you and your success.

Andrew Hancock - VMware vExpert
See if this solution works for you by signing up for a 7 day free trial.
Unlock 1 Answer and 3 Comments.
Try for 7 days

”The time we save is the biggest benefit of E-E to our team. What could take multiple guys 2 hours or more each to find is accessed in around 15 minutes on Experts Exchange.

-Mike Kapnisakis, Warner Bros