Dynamic creation of HTML form elements with PHP

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
User avatar
dallasx
Forum Contributor
Posts: 106
Joined: Thu Oct 20, 2005 4:55 pm
Location: California

Dynamic creation of HTML form elements with PHP

Post by dallasx »

I don't know what to search for when I want to make a user-friendly form (for a gamut of non-computer savvy people, yeah, I get all kinds).

I'd like to display a form, that's the easy part. Here are my input fields.
[text input: job number] [text input: work code] [text input: hours worked]

When the first field is clicked, I'd like a new row of fields to appear below it, dynamically adding rows of fields until the user submits the form.

The reason is that on any given day, anyone can work on X amount of projects, so I can't set a specific number of fields. Can this be done with PHP?
User avatar
feyd
Neighborhood Spidermoddy
Posts: 31559
Joined: Mon Mar 29, 2004 3:24 pm
Location: Bothell, Washington, USA

Post by feyd »

nope. That's Javascript's area of control.

We've discussed dynamic creation of form elements previously in the Client Side board.
Post Reply