View Single Post
Old 09-12-2012, 11:14 PM   PM User | #1
wcoil
New to the CF scene

 
Join Date: Sep 2012
Posts: 2
Thanks: 1
Thanked 0 Times in 0 Posts
wcoil is an unknown quantity at this point
Set multiple values for one field

Hello all,
New to the forum today. I am working on a form for a client and I am trying to get a radio button to be able to output two values and don't know how to do this.
For example, when a customer clicks on the New PC Purchase option it outputs the value of the text "new pc purchase" into textfield1 and then it also outputs the text "649.95" into textfield2.

This is the script that I have in place which returns the 649.95 only into a text field titled cost4output

<script type="text/javascript" src="http://o.aolcdn.com/dojo/1.1.0/dojo/dojo.xd.js"></script>
<script type="text/javascript">
dojo.addOnLoad(function () {
dojo.connect(dojo.byId("container2"), "onclick",
function () {
dojo.byId("cost4output").value = dojo.map(
dojo.filter(
dojo.query("#container2 [type='radio']"),
"return item.checked"
),
"return item.value"
)
multiply();
}
)
})
</script>

And here is the html snippet which has the output fields listed. The current code is working for the cost4output field. The second field which we would like to have the "new pc purchase" entered is called hardware_4

<input type=text name="cost4" onchange="addition()" value="" size="10" id="cost4output" class="totalField">
<input type="text" name="hardware4" id="hardware_4" size="55" />


And here is the html for the actual radio buttons.
<div id="container2"><font size="+1"><strong>Low End PC</font><br /><center>
outright
<input type="radio" name="radiogroup2" id="radiogroup2_0" value="649.95" />
2yr
<input type="radio" name="radiogroup2" id="radiogroup2_1" value="549.95" />
3yr
<input type="radio" name="radiogroup2" id="radiogroup2_2" value="449.95" />
</div>


Any help would be appreciated.
wcoil is offline   Reply With Quote