Ernesto
asked on
How to validate a email format in asp
how to validate if the email format its ok, then do not submit
set conn=Server.CreateObject("ADODB.Connection")
'conn.Provider="Provider=SQLOLEDB"
sql="INSERT INTO comentarios (nombre, email,telefono, producto, comentario)"
sql=sql & " VALUES "
sql=sql & "('" & Request.Form("fname") & "',"
sql=sql & "'" & Request.Form("email") & "',"
sql=sql & "'" & Request.Form("telefono") & "',"
sql=sql & "'" & Request.Form("consultorio") & "',"
sql=sql & "'" & Request.Form("message") & "')"
on error resume next
conn.Execute sql,recaffected
if err<>0 then
Response.Write("Error, Intente otro metodo de contacto!")
Response.Write("<a href='http://www.tasasystemasasmx.com/contacaato.html'><h3>Regresar a página de contacto.</h3></a>")
else
Response.Write("<h3>Nos pondremos en contacto lo antes posible.</h3>")
Response.Write("<a href='http://www.totalsyssdstems.com/indicase.html'><h3>Regresar a Oncología del Bajío.</h3></a>")
end if
conn.close
ASKER
I need do not submit the form and put a error message.
"for send a form please input a valid mail" or something like that
regards
"for send a form please input a valid mail" or something like that
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.
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Big Monty, will your regex work for the new tld's with more than 3 characters after the @ sign?
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
> 4 chars for the TLD.
yea, I would just nix that. I have one client with 6. This list shows the newest possibilities. http://data.iana.org/TLD/tlds-alpha-by-domain.txt
I think just having the @ sign with at least 2 characters after the period will not get you in trouble.
That gets you a quick validation of possibilities. But a true verification will be an actual email to the address verification.
yea, I would just nix that. I have one client with 6. This list shows the newest possibilities. http://data.iana.org/TLD/tlds-alpha-by-domain.txt
I think just having the @ sign with at least 2 characters after the period will not get you in trouble.
That gets you a quick validation of possibilities. But a true verification will be an actual email to the address verification.
ASKER
oh men,
tsm
I find this fancy way but
but i need to figured out when the email its okey acorrding to the "action="https://script.google.com/macros/s/AKfycbwMxYDrufp73bKdU8gMvxFDdHRuzcR4IKQUB33B7GqwyfyZS04/exec"
how to submit to my "action=contact.asp"
in order to save the fields in the database,
tsm
I find this fancy way but
<form method="post" action="https://script.google.com/macros/s/AKfycbwMxYDrufp73bKdU8gMvxFDdHRuzcR4IKQUB33B7GqwyfyZS04/exec">
<input type="text" name="email" id="email" required placeholder="Dirección de Email">
<span id="email-invalid" style="display:none">
Must be a valid email address
</span>
but i need to figured out when the email its okey acorrding to the "action="https://script.google.com/macros/s/AKfycbwMxYDrufp73bKdU8gMvxFDdHRuzcR4IKQUB33B7GqwyfyZS04/exec"
how to submit to my "action=contact.asp"
in order to save the fields in the database,
i dont understand what you're saying...did you try either one of our suggestions?
ASKER
This is the source
https://github.com/dwyl/html-form-send-email-via-google-script-without-server/blob/master/index.html#L11
I need to figured out when its ok then pass to my contact.asp
regards you experts,!
https://github.com/dwyl/html-form-send-email-via-google-script-without-server/blob/master/index.html#L11
I need to figured out when its ok then pass to my contact.asp
regards you experts,!
ASKER
i need 2 actions in the post
when its all ok acording
action="https://script.google.com/macros/s/AKfycbwMxYDrufp73bKdU8gMvxFDdHRuzcR4IKQUB33B7GqwyfyZS04/exec"
then do my action=contact.asp
regards
when its all ok acording
action="https://script.google.com/macros/s/AKfycbwMxYDrufp73bKdU8gMvxFDdHRuzcR4IKQUB33B7GqwyfyZS04/exec"
then do my action=contact.asp
regards
ASKER
oh men,
im prety lost in here
the only that i need were "requiered placeholder"
sorry im so new in this
im going to review your comments in order to see how to control a valid email format
regards
im prety lost in here
the only that i need were "requiered placeholder"
sorry im so new in this
im going to review your comments in order to see how to control a valid email format
regards
ASKER
Tsm
Open in new window
https://www.w3schools.com/asp/func_instr.asp