Go Back   CodingForums.com > :: Client side development > HTML & CSS

Before you post, read our: Rules & Posting Guidelines

Reply
 
Thread Tools Rate Thread
Enjoy an ad free experience by logging in. Not a member yet? Register.
Old 05-26-2011, 02:56 AM   PM User | #1
learninghard
New to the CF scene

 
Join Date: May 2011
Posts: 7
Thanks: 1
Thanked 0 Times in 0 Posts
learninghard is an unknown quantity at this point
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>
...
learninghard is offline   Reply With Quote
Old 05-26-2011, 03:05 AM   PM User | #2
Jethro
New Coder

 
Join Date: May 2011
Location: Australia
Posts: 16
Thanks: 0
Thanked 0 Times in 0 Posts
Jethro is an unknown quantity at this point
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
Jethro is offline   Reply With Quote
Old 05-26-2011, 05:08 AM   PM User | #3
bullant
Banned

 
Join Date: Feb 2011
Posts: 2,699
Thanks: 13
Thanked 395 Times in 395 Posts
bullant is on a distinguished road
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..
bullant is offline   Reply With Quote
Old 05-26-2011, 05:05 PM   PM User | #4
learninghard
New to the CF scene

 
Join Date: May 2011
Posts: 7
Thanks: 1
Thanked 0 Times in 0 Posts
learninghard is an unknown quantity at this point
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
learninghard is offline   Reply With Quote
Reply

Bookmarks

Tags
form, html, message, php, select

Jump To Top of Thread


Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +1. The time now is 10:26 PM.


Advertisement
Log in to turn off these ads.