Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 4 of 4
  1. #1
    New to the CF scene
    Join Date
    May 2011
    Posts
    7
    Thanks
    1
    Thanked 0 Times in 0 Posts

    Question need some help with form

    hi im kind new to codes and im starting get confused ,
    how can i get the option selected and send at end of message of form on that code?
    example:
    if option selected is "<OPTION value="grm@test.com" >test Card</OPTION>" this fomr will send a email to that value ,but i want but put at end of "menssage_txt" or at end of email that a text like this "option selected was test card".
    Code:
      ... <tr>
                    <td colspan="2">Select the area:                  
                      <select name="dSac[emailto_txt]">
                        <option>----------------- </option>
              <OPTION value="sac@test.com" selected>SAC</OPTION>
              <OPTION value="grm@test.com"                    >test Card</OPTION>
              <OPTION value="compras@test.com"     >Comercial</OPTION>
              <OPTION value="diretoria@test.com"   >Diretoria</OPTION>
              <OPTION value="financeiro@test.comr"  >Financeiro</OPTION>
              <OPTION value="informatica@test.com" >Inform&aacute;tica</OPTION>
              <OPTION value="vania@test.com, marcel@test.com, Jordan@test.com" >Jurídico</OPTION>
              <OPTION value="marketing@test.com"   >Marketing</OPTION>
              <OPTION value="dp@test.com"          >RH</OPTION>                    
                    </select></td>
                  </tr>
                  <tr>
                    <td colspan="2">leave a text here.</td>
                  </tr>
                  <tr>
                    <td colspan="2"><textarea  name="dSac[menssage_txt]" cols="75" rows="5" wrap="off"></textarea></td>
                  </tr>
                  <tr>
                    <td width="80">&nbsp;</td>
                    <td><input type="Submit" value="&nbsp;&nbsp;Enviar&nbsp;&nbsp;" /></td>
                  </tr>
                 </table>
                </form>
    ...

  • #2
    New Coder
    Join Date
    May 2011
    Location
    Australia
    Posts
    16
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Not quite sure what you are after but the select name value will be set to the value of the selected option. Are you using a scripting language after the form is submitted?

    For example in php it would be something like

    $email_text = mysql_real_escape_string($_POST[dSac['emailto_txt]']);

    HTH

  • #3
    Banned
    Join Date
    Feb 2011
    Posts
    2,699
    Thanks
    13
    Thanked 395 Times in 395 Posts
    If this is for a "real world" application, are you sure you want to expose email addresses in your html?

    Email address harvesters (bots) will swallow those up very quickly and say "YiuUUuumy - thank you very much".

    Why not have some other values like company names, or whatever, as the option values and then when the selected option is sent to your server side form processing script you can get the associated email address for the selected option from a database, array, text file or whatever and then send the email with its message to the email address.
    Last edited by bullant; 05-26-2011 at 05:10 AM.

  • #4
    New to the CF scene
    Join Date
    May 2011
    Posts
    7
    Thanks
    1
    Thanked 0 Times in 0 Posts
    Quote Originally Posted by bullant View Post
    If this is for a "real world" application, are you sure you want to expose email addresses in your html?

    Email address harvesters (bots) will swallow those up very quickly and say "YiuUUuumy - thank you very much".

    ...
    it will be a intranet service that im testing for now i dont have the rights to use the sql to put that in ,so i cant make any big changes


  •  

    Tags for this Thread

    Posting Permissions

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