Link to home
Start Free TrialLog in
Avatar of djb80
djb80

asked on

Radio button

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>
ASKER CERTIFIED SOLUTION
Avatar of Plucka
Plucka
Flag of Australia image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
djb80,

Sorry, last post was wrong question.

But you could just use DHTML and not reload.

Or when you reload, reload to an anchor.

Regards
Plucka
Avatar of djb80
djb80

ASKER

I don't understand your instructions.  
How do you just use DHTML and not reload?
How do you reload to an anchor?