Results 1 to 3 of 3

Thread: form values |RESOLVED|

  1. #1

    Thread Starter
    Fanatic Member davebat's Avatar
    Join Date
    Dec 2002
    Posts
    727

    form values |RESOLVED|

    how do i include a hidden value ina form that is the value of a select box from another form. I.E

    this is my form
    VB Code:
    1. <form name="period">
    2.   <select name="period" size="1">
    3.     <option value="04">04</option>
    4.     <option value="05">05</option>
    5.     <option value="06">06</option>
    6.     <option value="07">07</option>
    7.   </select>
    8. </form>

    and then in another form I have:

    VB Code:
    1. <form action="orion_s002.asp" method="post" name="form1" target="_self">
    2.  
    3. <input type="hidden" name="F_PROFILE" value="<%response.write V_PROFILE%>">
    4.  
    5.  <input type="hidden" name="F_ACCESS" value="<%response.write V_ACCESS%>">
    6.  
    7. <input type="hidden" name="F_PERIOD" value="javascript:document.period.value">


    this doesnt seem to work however and passes javascript:document.period.value as a text string. what am i doing wrong
    Last edited by davebat; Jul 24th, 2003 at 01:23 AM.

  2. #2
    Stuck in the 80s The Hobo's Avatar
    Join Date
    Jul 2001
    Location
    Michigan
    Posts
    7,256
    Try something like:

    Code:
    <form name="period">
      <select name="period" size="1" onChange="document.forms('form1').F_PERIOD.value=this.value">
        <option value="04">04</option>
        <option value="05">05</option>
        <option value="06">06</option>
        <option value="07">07</option>
      </select>
    </form>
    I tested it and it works (IE6), but I'm not sure if it's valid in all browsers.
    My evil laugh has a squeak in it.

    kristopherwilson.com

  3. #3

    Thread Starter
    Fanatic Member davebat's Avatar
    Join Date
    Dec 2002
    Posts
    727
    cheers that works great

Posting Permissions

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



Click Here to Expand Forum to Full Width