I am using a simple HTML form as a contact, and when the field is submitted and the field is submitted Is not cleaned
This is my php. I read online at some places and I have learned that I Using Reset, but I do not know much from php. I'm not sure how I will reset and how to add.
& lt;? $ Name = $ _REQUEST ["name"]; $ Email = $ _REQUEST ["email"]; $ Msg = $ _REQUEST ["msg"]; $ From = "example@example.com"; If (isset ($ email) & amp; amp; and; ($ name) & amp; amp; amp; and isset ($ msg)) {$ subject = "message / closed movie"; $ Header = "MIME-version: 1.0" "\ r \ n"; $ Headers = "Content-type: text / html; charset = ISO-885 9-1". "\ R \ n"; $ Headers = "Sender:". $ Name ". & Lt;" $ Email "& Gt; \ r \ n". "Answer:" $ email "\ R \ n"; $ Msg = "Name: $ name: & lt; br / & gt; Email: $ email
message: $ msg"; $ Mail = Mail ($ $ $ theme, $ msg, $ header); If ($ Mail) {echo 'success'; } Else {echo 'unsuccessful'; }}? & Gt;
My html
& lt; Div id = "contact" & gt; & Lt; Div class = "container" & gt; & Lt; Div class = "row-liquid page page" & gt; & Lt; Div class = "span12" & gt; & Lt; H3 & gt; Contact America & lt; Span & gt; & Lt; Img src = "picture / underline" alt = "______" & gt; & Lt; / Span & gt; & Lt; / H3 & gt; & Lt; / Div & gt; & Lt; / Div & gt; & Lt; Div class = "line-fluid contact access" & gt; & Lt; Div class = "span6 offset3" & gt; & Lt; Form class = "form-horizontal" id = "phpcontactform" & gt; & Lt; Div class = "control-group" & gt; & Lt; Input class = "input-block-level" type = "text" placeholder = "full name" name = "name" id = "name" & gt; & Lt; / Div & gt; & Lt; Div class = "control-group" & gt; & Lt; Input class = "input-block-level" type = "email" placeholder = "email" name = "email" id = "email" & gt; & Lt; / Div & gt; & Lt; Div class = "control-group" & gt; & Lt; Textarea class = "input-block-level" rows = "10" name = "message" placeholder = "your message" id = "message" & gt; & Lt; / Textarea & gt; & Lt; / Div & gt; & Lt; Div class = "control-group" & gt; & Lt; P & gt; & Lt; Input class = "BTN BTN-Danger BTN-Large" type = "submit" value = "Send message" & gt; & Lt; / P & gt; & Lt; Span class = "loading" & gt; & Lt; / Span & gt; & Lt; / Div & gt; & Lt; / Form & gt; & Lt; / Div & gt;
added this to the top of my HTML but found no result
Try:
& lt; Script type = "javascript" & gt; $ (Document) .ready (function () {$ ('# phpcontactform') [0] .reset ();}); & Lt; / Script & gt;
I'm not sure if you are trying to submit an AJAX, submit the user to the page or submit the form. But the line you are looking for is $ ("# phpcontactform") [0]. Reset ();
, you can wrap it in the $ .ready ()
if you need it!
Comments
Post a Comment