Jump to content

Dynamically Adding Text-Boxes??


doubledee

Recommended Posts

I am building an Event Registration system, and am thinking that it should put the Attendee's name on the Ticket (and in the database) as a backup.

 

Is there a way to easily (and dynamically) display the same number of Text-Boxes as the # of Attendees entered?

 

For example, let's say the Customer (payor) wants to buy Tickets for herself and 5 friends to a Banjo Festival. 

 

Right now, I just have a drop-down box to capture the head-count, but it would be nice to have 5 Text-Boxes (or something appear) so that the Customer can easily type in the Names of the 5 Attendees *without* having to suffer numerous other clicks and/or screens.

 

Follow me?

 

Is there a way to do that?

 

Thanks,

 

 

 

Debbie

 

Link to comment
Share on other sites

you can loop through the records and show textboxes equal to the number of records returned. and putting textbox name as array like this.

<input type='textbox' id='something' name='something[]'  value='{field returned from database}'/>

 

And then you can loop through it in a submit page to save it back.

 

 

Link to comment
Share on other sites

you can loop through the records and show textboxes equal to the number of records returned. and putting textbox name as array like this.

<input type='textbox' id='something' name='something[]'  value='{field returned from database}'/>

 

And then you can loop through it in a submit page to save it back.

 

You got it backwards...

 

I need the Text-Boxes so I can gather Names to put INTO my database!  :P

 

 

Debbie

 

Link to comment
Share on other sites

I know you have an aversion to Javascript but its really the only way to do it without submitting the number of attendees first :)

 

1.) How hard would that be?

 

2.) What happens if the User has JavaScript turned off?

 

3.) Couldn't I capture the Event and # of Attendees on one page - which is what I have now - and then load a new page which has ____ Text-Boxes to add names?

 

It is an extra screen, but maybe not so bad and it avoids the need for JavaScript, right?

 

 

Debbie

 

 

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.