Ernesto
asked on
get name for asp on select
<form method="post" action="contact.asp">
<b>Envíenos un mensaje</b> <span></span>
<input type="text" name="fname" id="fname" value="Nombre">
<input type="text" name="email" id="email" value="Dirección de Email">
<select name="Consultorio">
<option>Elija Consultorio...</option>
<option>Queretaro</option>
<option>San Miguel</option>
</select>
<textarea name="message" id="message" cols="30" rows="10">Escriba aquí su mensaje...</textarea>
<input type="submit" name="send" id="send" value="Enviar Mensaje">
</form>
how do i set a input name in the select in order to asp read the select option?
regards
<b>Envíenos un mensaje</b> <span></span>
<input type="text" name="fname" id="fname" value="Nombre">
<input type="text" name="email" id="email" value="Dirección de Email">
<select name="Consultorio">
<option>Elija Consultorio...</option>
<option>Queretaro</option>
<option>San Miguel</option>
</select>
<textarea name="message" id="message" cols="30" rows="10">Escriba aquí su mensaje...</textarea>
<input type="submit" name="send" id="send" value="Enviar Mensaje">
</form>
how do i set a input name in the select in order to asp read the select option?
regards
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
+ on line 6 above, use
Replace(Request.Form("mess age"),"'", "''")
just in case message contains '
Replace(Request.Form("mess
just in case message contains '
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
Oh men , tnkx guys
ASKER
Thank you experts
how is this an answer? all it is is your sql w/out any explanation......
ASKER
im just put in my asp the huseyn syntax and works just put up my second line into only one
sql=sql & "comentario)"
regards
sql=sql & "comentario)"
regards
not trying to be a jerk here, but all that answer does is reformat the string. the actual cause of the problem was there were no values being passed to the page, because the VALUE attribute wasn't specified. it had nothing to do with the format of a variable....
not reformat, he forgot to add "," between "producto" and "comentario"
also, I combined those into one line to look nice :)
also, he forgot to add values to options in aspx
also, I combined those into one line to look nice :)
also, he forgot to add values to options in aspx
ASKER
sql="INSERT INTO comentarios (nombre,email,producto"
sql=sql & "comentario)"
sql=sql & " VALUES "
sql=sql & "('" & Request.Form("fname") & "',"
sql=sql & "'" & Request.Form("email") & "',"
sql=sql & "'" & Request.Form("consultorio"
sql=sql & "'" & Request.Form("message") & "')"
on error resume next
conn.Execute sql,recaffected
if err<>0 then
Response.Write("No update permissions!")
else
Response.Write("<h3>" & recaffected & " Nos pondremos en contacto con usted cuanto antes</h3>")
end if