View Menu

Technical Support Forums

Free, outstanding support from WebAssist and your colleagues

Dynamically adding code in Dreamweaver CS4

Thread began 5/07/2009 5:16 pm by gwh362692 | Last modified 5/12/2009 3:26 am by gwh362692 | 1588 views | 2 replies

gwh362692

Dynamically adding code in Dreamweaver CS4

Hi everyone,

I have the code below (see bottom of post) inside a form within Dreamweaver CS4. There's a dropdown menu where people can select the number of guests that will be attending an event, then beneath this are two text fields - one for firstname and the other for lastname - where they enter the name of the guest attending. Since they can choose from up to 15 from the guest dropdown menu indicating the amount of guests attending, I'd need there to be 14 more blocks of code like this:

<p>
<label for="guestFirstName">Firstname:</label>
<input type="text" name="guestFirstName" id="guestFirstName" tabindex="50" />
<label for="guestLastName">Last Name</label>
<input type="text" name="guestLastName" id="guestLastName" />
<br />
</p>

...that would allow them to enter further names for their guests if a higher number was chosen from the dropdown menu.

Is there a way either in Dreamweaver directly (or with one of the WA add-ons) to have added text fields inserted automatically based on the number of guests chosen in the dropdown? So say for example, if someone chose 5 guests, then a further 4 blocks of the above code would get inserted automatically?

Is this possible to do and if yes can someone explain how I'd go about it?

Or as an alternative, would there be a way to have a button for them to click so that more text fields are added as they need them, ie. if they chose 5 guests, then they'd click the button 5 times to add more text fields.

Thanks for any advice.




<fieldset>
<legend>Additional Guests</legend>
<p>Will you require ticketing for extra guests?<br />
<label>
<input type="radio" name="extraGuests" value="Yes" id="extraGuests_0" tabindex="20" />
Yes</label>
<br />
<label>
<input type="radio" name="extraGuests" value="No" id="extraGuests_1" tabindex="30" />
No</label>
</p>
<p>If yes, please provide the following details:<br />
<label for="OrderNumGuests">Number of Guests:</label>
<select name="OrderNumGuests2" id="OrderNumGuests" tabindex="40">
<option value="" selected="selected">-- Select a number --</option>
<option value="1">1</option>
<option value="2">2</option>
<option value="3">3</option>
<option value="4">4</option>
<option value="5">5</option>
<option value="6">6</option>
<option value="7">7</option>
<option value="8">8</option>
<option value="9">9</option>
<option value="10">10</option>
<option value="11">11</option>
<option value="12">12</option>
<option value="13">13</option>
<option value="14">14</option>
<option value="15">15</option>
</select>
<br />
</p>
<p>Name of Guest(s):</p>
<p>
<label for="guestFirstName">Firstname:</label>
<input type="text" name="guestFirstName" id="guestFirstName" tabindex="50" />
<label for="guestLastName">Last Name</label>
<input type="text" name="guestLastName" id="guestLastName" />
<br />
</p>
</fieldset>

Build websites with a little help from your friends

Your friends over here at WebAssist! These Dreamweaver extensions will assist you in building unlimited, custom websites.

Build websites from already-built web applications

These out-of-the-box solutions provide you proven, tested applications that can be up and running now.  Build a store, a gallery, or a web-based email solution.

Want your website pre-built and hosted?

Close Windowclose

Rate your experience or provide feedback on this page

Account or customer service questions?
Please user our contact form.

Need technical support?
Please visit support to ask a question

Content

rating

Layout

rating

Ease of use

rating

security code refresh image

We do not respond to comments submitted from this page directly, but we do read and analyze any feedback and will use it to help make your experience better in the future.

Close Windowclose

We were unable to retrieve the attached file

Close Windowclose

Attach and remove files

add attachmentAdd attachment
Close Windowclose

Enter the URL you would like to link to in your post

Close Windowclose

This is how you use right click RTF editing

Enable right click RTF editing option allows you to add html markup into your tutorial such as images, bulleted lists, files and more...

-- click to close --

Uploading file...