• Jobs
  • About Us
  • professionals
    • Home
    • Jobs
    • Courses and challenges
  • business
    • Home
    • Post vacancy
    • Our process
    • Pricing
    • Assessments
    • Payroll
    • Blog
    • Sales
    • Salary Calculator

0

140
Views
How can i dynamically set the number of rows based on the value of an input box

I am trying to set the number of rows containing form fields based on the value of an input box. How can I accomplish this? Code snippet below. Basically I want to loop the value in the "numpos" field. Ideally I'd like to have it dynamically update when the user types a number in the numpos field.

<tr>
  <th>Number Of Positions:</th>
  <td colspan="4"><cfinput type="text" name="numpos" required="yes" message="Please enter the number of positions"></td>
</tr>
<cfif #mynum# NEQ 0>
  <cfloop from="1" to="#mynum#" index="i">
    <tr>
      <th>Number Of People Needed:</th>
      <th>Position Description:</th>
      <th>Date:</th>
      <th>Start Time:</th>
      <th>End Time:</th>
    </tr>
    <tr>
      <td><cfinput type="text" name="numpeople"></td>
      <td><cfinput type="text" name="posdesc"></td>
      <td><cfinput type="text" name="posdate"></td>
      <td><cfinput type="text" name="starttime"></td>
      <td><cfinput type="text" name="endtime"></td>
    </tr>
  </cfloop>
</cfif>
almost 3 years ago · Juan Pablo Isaza
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Our process Sales
Legal
Terms and conditions Privacy policy
© 2025 PeakU Inc. All Rights Reserved.

Andres GPT

Recommend me some offers
I have an error