Log in

View Full Version : pass 2 different values in a form?



munkynpunky
10-03-2006, 11:49 PM
Hey guys,

Im passing this type of form


<select name="app" id="app">
<option value="0.00" selected="selected">None</option>
<option value="3.00">Option1</option>
<option value="3.00">Option2</option>
<option value="3.00">Option3</option>
<option value="3.00">Option4</option>
</select>


however when it is emailed to me, obviously i get the value (3.00), now what i really want passing to me is the Option1, Option2 info... but the value has to be 3.00 as it is passed to a javascript script elsewhere..

so, i've googled and searched but dont seem to be able to find anything...

is there a way to achieve this?

Drew

blm126
10-04-2006, 12:54 AM
I don't think so. Your best bet is to modify the other script. Can we see that script?

munkynpunky
10-04-2006, 01:05 AM
<select name='app' id='app' onchange='appcost.value=this.value'>

<option value="0.00" selected="selected">None</option>
<option value="3.00">Prod1</option>
<option value="3.00">Prod2</option>
<option value="3.00">prod3</option>
</select>

<input name='appcost' type='text' id='appcost' value='3.00'>


<input name="button" type='button' onclick='this.form.answer.value = (this.form.cost.value - 0) + (this.form.hostresult.value - 0) + (this.form.appcost.value - 0)' value='Re-Calculate' />

munkynpunky
10-04-2006, 01:08 AM
Basically this takes 3 drop downs with number results in and adds them up, but because all the figures are different on the other drop downs i did a script which says basically,
if $cost = "45.00" then $title = "gold standard" (i know this isnt the correct scripting.. but you know what i mean..

But as all my options (all 31 of them) are just 3.00 then there is no way to assign a title in php, in the same way as above...

blm126
10-04-2006, 03:05 AM
well then in your other script(the one doing the adding) modify it to work based on the class name property. If you need help with that, I need the whole script.

munkynpunky
10-05-2006, 12:02 AM
Hi,

This is all i do to work out the maths..



<input name="button" type='button' onclick='this.form.answer.value = (this.form.cost.value - 0) + (this.form.hostresult.value - 0) + (this.form.appcost.value - 0)' value='Re-Calculate' />