Results 1 to 2 of 2

Thread: need help passing option value to hidden value

  1. #1
    ld1084 Guest

    need help passing option value to hidden value


    This is prob. a simple thing, I need to know how to update the hidden field, so when the user selects a person from the drop down, that selected user's email address will pass through to the asp script for email.

    Thanks in advance.


    <div align="center">
      <table border="0" cellpadding="5" width="55%">
          <td width="100%" bgcolor="#DADADA">
    <form action="scripts/formmail.asp" method="POST">
      <td width="65" height="13" class="subtitle">Supervisor</td>
                            <td height="13" class="textbluedk"><select name="Supervisor" id="select">
                              <option value="">User 1</option>
                              <option value="">User 2</option>
                              <option value="">User 3</option>
                              <option value="">User 4</option>
                              <option value="">User 5</option>
                              <option value="">User 6</option>
                              <option value="">User 7</option>
    <input type="text" name="textfield">
    <font face="Verdana" size="2">
    <input type="submit" value="Submit">
    <input type="reset" value="Clear">
    <input type="hidden" name="_fieldOrder" value="MessageType,Subject,Comments,Name,Email,Telephone,Fax,ContactRequested">
    <input type="hidden" name="recipient" value="recipient">
    <input type="hidden" name="_subject" value="ASP FormMail Test Form">

  2. #2
    Join Date
    May 2009

    Try here for an explanation:

    It's a mix of using onChange for your dropdown form (you need a blank, null value as the default option) and the array of the dropdown and selectedIndex.

    You can feed that value into your form using something like

    document.getElementById('idName').value = x

    where idName is the ID of your input box (hidden or not, it doesn't matter) and x is the output from your onChange.

    I hope that helps.



Similar Threads

  1. hidden control problem in IE 7.0
    By sghsgm in forum General Questions
    Replies: 0
    Last Post: 27 Oct 2008, 07:17 AM
  2. posting hidden form data to a popup window
    By simora in forum Client & Server Side Scripting (PHP, ASP, JavaScript)
    Replies: 0
    Last Post: 26 May 2007, 04:47 AM
  3. Printing elements hidden by JavaScript
    By Anastasia in forum Web Design, HTML Reference and CSS
    Replies: 1
    Last Post: 09 Jan 2006, 01:30 PM

Posting Permissions

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