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
    Jun 2006
    Posts
    46
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Checking to see what button the user pressed.

    Hello to All,

    I have a web page I am trying to create Its a form that allows users to enter in career information . The problem is that I have 1 row shown to the user at a time and when the user presses the (Add new) button, I want another row to appear to let the user enter more career information. I have figured out a way to do this using <cfif IsDefined("FORM.Add")> , But I don't want to send the form to the server, I just want to check the button and then add a new line without a form.submit, because right now I have 2 forms on the page. Is there anyway to check the button pressed without a form submit. Like is there a coldfusion check to see what button has been pressed.


    sample code:

    Code:
    <cfform name="FormalSubmit" id="FormalSubmit" method="post" action="">
    
    <table  align="center" width="760" border="2" cellspacing="1" cellpadding="2" summary="summary">
    
      <tr><td colspan="100" bgcolor="##000066" style="color: white; text-align: left;"><strong> FORMAL EDUCATION</strong></td></tr>
       <tr>
        <td nowrap style="color: black;text-align: left; "><strong>Name of Institution and City/State</strong> </td>
        <td style="color: black; text-align: left;"><strong>Field(s) of Study</strong> 
        </td>
         <td nowrap style="color: black; text-align: left;"><strong>Years Attended</strong></td>
          <td nowrap style="color: black; text-align: left;"><strong>Degree</strong> </td>
          <td>&nbsp;</td>
      </tr> 
      
         <tr>
        <td ><cfinput name="Institution" value= "#Institution#" type="text" size="40" maxlength="50" required="yes" message="Please enter your Institution."></td>
        <td >
        <cfinput name="Study" value= "#Study#" type="text" size="25" maxlength="50" required="yes" message="Please enter your Field of Study.">
        </td>
         <td>
         <cfinput name="Attended" value= "#Attended#" type="text" size="15" maxlength="50" required="yes" message="Please enter years attended.">
         </td>
          <td >
           <cfinput name="Degree" value= "#Degree#" type="text" size="30" maxlength="50" required="yes" message="Please enter your degree."> 
          
          </td>
           <td >
          <input type="submit" value="Add New" name="Add"> 
          </td>
      </tr> 
      
       <cfif IsDefined("FORM.Add")>  
         <tr>
        <td ><cfinput name="Institution2" value= "#Institution#" type="text" size="40" maxlength="50" required="yes" message="Please enter your Institution."></td>
        <td >
        <cfinput name="Study2" value= "#Study#" type="text" size="25" maxlength="50" required="yes" message="Please enter your Field of Study.">
        </td>
         <td>
         <cfinput name="Attended2" value= "#Attended#" type="text" size="15" maxlength="50" required="yes" message="Please enter years attended.">
         </td>
          <td >
           <cfinput name="Degree2" value= "#Degree#" type="text" size="30" maxlength="50" required="yes" message="Please enter your degree."> 
          
          </td>
           <td >
          <input type="submit" value="Add New" name="Add"> 
          </td>
      </tr>
       </cfif> 
       </cfform>
    </table>


    Thank you.

  • #2
    New to the CF scene
    Join Date
    Nov 2008
    Posts
    3
    Thanks
    0
    Thanked 0 Times in 0 Posts
    That sounds like a javascript or ajax solution


  •  

    Posting Permissions

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