Go Back   CodingForums.com > :: Server side development > Other server side languages/ issues > ColdFusion

Before you post, read our: Rules & Posting Guidelines

Reply
 
Thread Tools Rate Thread
Enjoy an ad free experience by logging in. Not a member yet? Register.
Old 09-09-2008, 08:19 PM   PM User | #1
bsharif
New Coder

 
Join Date: Jun 2006
Posts: 46
Thanks: 0
Thanked 0 Times in 0 Posts
bsharif is an unknown quantity at this point
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.
bsharif is offline   Reply With Quote
Old 11-06-2008, 08:12 AM   PM User | #2
kjab
New to the CF scene

 
Join Date: Nov 2008
Posts: 3
Thanks: 0
Thanked 0 Times in 0 Posts
kjab is an unknown quantity at this point
That sounds like a javascript or ajax solution
kjab is offline   Reply With Quote
Reply

Bookmarks

Jump To Top of Thread


Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +1. The time now is 03:26 AM.


Advertisement
Log in to turn off these ads.