Advanced Search

Results 1 to 6 of 6

Thread: pass 2 different values in a form?

  1. #1
    Join Date
    Sep 2006
    Posts
    48
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default pass 2 different values in a form?

    Hey guys,

    Im passing this type of form
    HTML Code:
    <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

  2. #2
    Join Date
    Sep 2005
    Posts
    882
    Thanks
    0
    Thanked 3 Times in 3 Posts

    Default

    I don't think so. Your best bet is to modify the other script. Can we see that script?

  3. #3
    Join Date
    Sep 2006
    Posts
    48
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    HTML Code:
    <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' />

  4. #4
    Join Date
    Sep 2006
    Posts
    48
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    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,
    PHP Code:
    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...

  5. #5
    Join Date
    Sep 2005
    Posts
    882
    Thanks
    0
    Thanked 3 Times in 3 Posts

    Default

    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.

  6. #6
    Join Date
    Sep 2006
    Posts
    48
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    Hi,

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

    HTML Code:
    <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' />

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •