close ad
WARNING: Do Not Install the DREAMWEAVER CC 2017 Update »
open ad
View Menu

Technical Support Forums

Free, outstanding support from WebAssist and your colleagues

Ajax with Repeat Selection

Thread began 9/19/2009 2:43 pm by Bknvc1111729 | Last modified 9/27/2009 11:30 pm by Bknvc1111729 | 852 views | 2 replies

Jason ByrnesWebAssist

The problem is all of the form elements have the same name.

You need to use the increment counter to give each on a unique name and pass the incrrement counter in your ajax function call:


// RepeatSelectionCounter_1 Begin Loop
$RepeatSelectionCounter_1_IterationsRemaining $RepeatSelectionCounter_1_Iterations;
$RepeatSelectionCounterBasedLooping_1 || $row_None){
        <td><select name="Width_<?php echo $RepeatSelectionCounter_1?>" id="Width_<?php echo $RepeatSelectionCounter_1?>" onChange="updateDiameter(<?php echo $RepeatSelectionCounter_1?>);">
            <option value="" selected="selected"></option>
            <option value="235">235</option>
        <td><select name="AspectRatio_<?php echo $RepeatSelectionCounter_1?>" id="AspectRatio_<?php echo $RepeatSelectionCounter_1?>" onChange="updateDiameter(<?php echo $RepeatSelectionCounter_1?>);">
            <option value="" selected="selected"></option>
            <option value="35">35</option>
        <td><select name="Diameter_<?php echo $RepeatSelectionCounter_1?>" id="Diameter_<?php echo $RepeatSelectionCounter_1?>" onChange="updateDiameter(<?php echo $RepeatSelectionCounter_1?>);">
            <option value="" selected="selected"></option>
            <option value="19">19</option>
        <td><input name="SectionWidth_<?php echo $RepeatSelectionCounter_1?>" type="text" id="SectionWidth_<?php echo $RepeatSelectionCounter_1?>" value="" size="3" /></td>
        <td><input name="SectionHeight_<?php echo $RepeatSelectionCounter_1?>" type="text" id="SectionHeight_<?php echo $RepeatSelectionCounter_1?>" value="" size="3" /></td>
        <td><input name="OverallHeight_<?php echo $RepeatSelectionCounter_1?>" type="text" id="OverallHeight_<?php echo $RepeatSelectionCounter_1?>" value="" size="3" /></td>
// RepeatSelectionCounter_1 Begin Alternate Content
    <?php // RepeatSelectionCounter_1 End Alternate Content
if(!$RepeatSelectionCounterBasedLooping_1 && $RepeatSelectionCounter_1_IterationsRemaining != 0){
$row_None && $RepeatSelectionCounter_1_Iterations == -1){$RepeatSelectionCounter_1_IterationsRemaining 0;}
$row_None mysql_fetch_assoc($None);
// RepeatSelectionCounter_1 End Loop

then to use the increment in the funct5ion call, change the script to:

function updateDiameter(i)
var section = parseFloat(document.getElementById('Width_'+i).value * 1);
var aspect = parseFloat(document.getElementById('AspectRatio_'+i).value * 1);
var diameter = parseFloat(document.getElementById('Diameter_'+i).value * 1);

section_width = (section / 25.4);
document.getElementById('SectionWidth_'+i).value = section_width.toFixed(2);

section_height = (section_width * aspect / 100);
document.getElementById('SectionHeight_'+i).value = section_height.toFixed(2);

overall = ((section_height * 2) + diameter);
document.getElementById('OverallHeight_'+i).value = overall.toFixed(1);


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





Ease of use


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...