×
INTELLIGENT WORK FORUMS
FOR COMPUTER PROFESSIONALS

Log In

Come Join Us!

Are you a
Computer / IT professional?
Join Tek-Tips Forums!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!
  • Students Click Here

*Tek-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

Posting Guidelines

Promoting, selling, recruiting, coursework and thesis posting is forbidden.

Students Click Here

Jobs

Timesheet entry form that auto-fills the Date range?

Timesheet entry form that auto-fills the Date range?

Timesheet entry form that auto-fills the Date range?

(OP)
I currently have a ColdFusion form & need to add a "Week Selector" drop-down above my table so that:
- when the week is chosen from the drop-down, (how do I generate these drop-down values?)
- the correct dates are added to the date fields in the form.. (how do I populate the text boxes?)
- Once the user chooses the week, the Sun-Sat dates update, he then enters his time for each day..

--Choose Week-->Nov 3 thru Nov 9<-- (drop-down)

Sun---Mon---Tue---Wed---Thu---Fri---Sat (static labels)
---------------------------------------
11/03 11/04 11/05 11/06 11/07 11/08 11/09 (text boxes for dynamic dates)
0 8 8 8 8 8 (text boxes for hours entry)


Here is a picture of what I'm trying to duplicate:
https://dl.dropboxusercontent.com/u/58096637/Times...

RE: Timesheet entry form that auto-fills the Date range?

(I couldn't see your "picture" due to a proxy block.)

Are you using CFFORM? You can use CFSELECT to construct the dropdown. From there, you can use Javascript to populate the date boxes.

-----------
With business clients like mine, you'd be better off herding cats.

RE: Timesheet entry form that auto-fills the Date range?

(OP)
For now I have the form laid out using a table like this:

<p>Choose Week
<select name="Choose Week" id="ChooseWeek">
</select>
</p>
<table>

<thead>
<tr>
<th>Payroll Item</th>
<th>Mon<br>
11/04</th>
<th>Tue<br>
11/05</abbr></th>
<th>Wed<br>
11/06</th>
<th>Thu<br>
11/07</th>
<th>Fri<br>
11/08</th>
<th>Sat<br>
11/09</th>
<th>Sun<br>
11/10</th>
<th>Description</th>
</tr>
</thead>

<tbody>
<tr>
<th><select name="select-choice-1" id="select-choice-1" data-native-menu="false" data-theme="c">
<option value="Regular Hourly Rate">Regular Hourly Rate</option>
<option value="Paid Leave Time">Paid Leave Time</option>
<option value="Bereavement">Bereavement</option>
<option value="Holiday Pay">Holiday Pay</option>
</select></th>
<td><input name="mon" type="text" id="mon" value="8.0" size="10" maxlength="5"></td>
<td><input type="text" name="tue" id="tue" value="8.0" size="10" maxlength="5"></td>
<td><input type="text" name="wed" id="wed" value="8.0" size="10" maxlength="5"></td>
<td><input type="text" name="thu" id="thu" value="8.0" size="10" maxlength="5"></td>
<td><input type="text" name="fri" id="fri" value="8.0" size="10" maxlength="5"></td>
<td><input type="text" name="sat" id="sat" value="8.0" size="10" maxlength="5"></td>
<td><input type="text" name="sun" id="sun" value="8.0" size="10" maxlength="5"></td>
<td><label><input name="desc" type="text" id="desc" size="15" maxlength="50">
</label></td>
</tr>
</tbody>

</table>

RE: Timesheet entry form that auto-fills the Date range?

The solution is more complicated than I have time to write an example, but the gist is this:

Populate the dropdown with meaningful values for the beginning of your time period week, e.g. "11/11/2013" for the current week. Hint: make sure to have the first value be "Select a Week".

In the onChange event handler of the dropdown, invoke a function that 1) grabs the date value of the selected dropdown item, and 2) spins through each textbox value, populating it with date+1 (that is, the value passed to the function by the dropdown)

So the function would populate the first box. Then,

for (x = 1 to 6)
{
textbox.value = (See a tutorial about Javascript date math at http://www.htmlgoodies.com/beyond/javascript/javas...)
}

As you can see this is more of a Javascript than a ColdFusion problem. But you can control the values in the dropdown on the server side with a payroll calendar.

-----------
With business clients like mine, you'd be better off herding cats.

Red Flag This Post

Please let us know here why this post is inappropriate. Reasons such as off-topic, duplicates, flames, illegal, vulgar, or students posting their homework.

Red Flag Submitted

Thank you for helping keep Tek-Tips Forums free from inappropriate posts.
The Tek-Tips staff will check this out and take appropriate action.

Reply To This Thread

Posting in the Tek-Tips forums is a member-only feature.

Click Here to join Tek-Tips and talk with other members!

Close Box

Join Tek-Tips® Today!

Join your peers on the Internet's largest technical computer professional community.
It's easy to join and it's free.

Here's Why Members Love Tek-Tips Forums:

Register now while it's still free!

Already a member? Close this window and log in.

Join Us             Close