Editing a basic contact form using hre - html

I have this template where I customized whats on it BUT i got stuck on the contact page where the contact form upon clicking the button clear OR send button nothing happens. I really don't know much about most of the stuff ALL are from research through net but can't get to fix this. Am I missing something here?
Questions I have in mind:
1. Do I need to put something or create in "action"
2. What do I have to put in "href" to clear or send the form to my email?
Or you have a better idea.
<h2 class="p0">Contact Form</h2>
<form id="contact-form" action="#" method="post" enctype="multipart/form-data">
<fieldset>
<label><span class="text-form">Name:</span>
<input name="p1" type="text" />
</label>
<label><span class="text-form">Email:</span>
<input name="p2" type="text" />
</label>
<div class="wrapper">
<div class="text-form">Message:</div>
<textarea></textarea>
</div>
<div class="buttons"> <a class="button-2" href="#">Clear</a> <a class="button-2" href="#">Send</a> </div>
</fieldset>
</form>

Use real buttons, don't just give them a class called buttons.
In action, put down the name of the server file that will process this form, for example action="contact_form.php". If you would like to send an email, put down action="MAILTO:someone#example.com".
<h2 class="p0">Contact Form</h2>
<form id="contact-form" action="MAILTO:someone#example.com" method="post" enctype="multipart/form-data">
<fieldset>
<label><span class="text-form">Name:</span>
<input name="name" type="text" />
</label>
<label><span class="text-form">Email:</span>
<input name="email" type="text" />
</label>
<div class="wrapper">
<div class="text-form">Message:</div>
<textarea name="message"></textarea>
</div>
<div class="buttons">
<input type="button" value="Clear" onclick="document.getElementById('contact-form').reset()"
/>
<input type="submit" value="Send" />
</div>
</fieldset>
</form>

Related

FormSubmit says my form should use method=POST but it actually does

I'm using FormSubmit to create a contact form in my static website (hosted on a server).
My form looks like this:
<div id="contact-area" class="container">
<h1>~$ contactme</h1>
<br>
<form action="https://formsubmit.co/c379c266434ca1a039bdf03209919395" method="POST">
<div class="form-group">
<div class="form-row">
<div class="col">
<input type="text" name="name" class="form-control" placeholder="Your name..." required>
</div>
<div class="col">
<input type="email" name="email" class="form-control" placeholder="Your e-mail" required>
</div>
</div>
</div>
<div class="form-group">
<textarea maxlength="1000" placeholder="Your message..." class="form-control" name="message" rows="10" required></textarea>
</div>
<input type="hidden" name="_template" value="table">
<input type="text" name="_honey" style="display:none">
<input type="hidden" name="_captcha" value="false">
<input type="hidden" name="_next" value="message_sent.html">
<button type="submit" class="btn btn-lg btn-dark btn-block">Submit</button>
</form>
</div>
My email is verified. When the user clicks on submit button, this message appears in a new page:
" Make sure your form has the method="POST" attribute "
However, I receive the message. That's weird. Anyone know why it says my form should have POST attribute while my form actually has the post attribute.
Your code snippet is all okay. I have tested it, forms are getting submitted, and nothing wrong except the way you implement the "_next" feature. As FormSubmit documentation clearly mentioned you have to provide an alternative URL not just a path or file, it should be a URL.
<input type="hidden" name="_next" value="https://yourdomain.co/thanks.html">
Please change the hidden filed in your form to:
<input type="hidden" name="_next" value="https://yourdomain.co/message_sent.html">
and that should probably work fine.
Additional information:
FormSubmit documentation: https://formsubmit.co/documentation
I guess you have gone wrong in the action of the form.
Try using this:
<form action="https://formsubmit.co/your#email.com" method="POST">
<!-- Your form inputs here -->
</form>

How do I access form1 action and data with submit button of form2 in html

I found xhtml that looks like this:
<div class="mail_area">
<div class="mail">
<div class="mail_lef"></div>
<div class="mail_cen">
<form action="">
<input type="text" value="Enter your E-mail for instant
access..." name="Enter your E-mail" class="txtinput" onfocus="if(this.value==this.defaultValue)this.value=''" onblur="if(this.value=='')this.value=this.defaultValue"/>
</form>
</div>
<div class="mail_rig"></div>
</div>
</div>
<div class="arrow_area">
<div class="left_arr"></div>
<div class="cen_but">
<span class="cen_text"><sup class="red">*</sup>We value your privacy and would never share your information.</span>
<form action="">
<input type="button" class="button" name="submit" align="middle"/>
</form>
</div>
<div class="rig_arr"></div>
</div>
In the first form I am going to add a method and an action.
It looks as though the second form was created this way so it could be lined up with other images.
So my question is, how can I setup the button in the second for to use the input information and get access to the action attribute of the first form?
Thanks for the help.
The easiest way to do this would be to turn this into one form instead of two. Otherwise you would have to use javascript.
<form action="">
<div class="mail_area">
<div class="mail">
<div class="mail_lef"></div>
<div class="mail_cen">
<input type="text" value="Enter your E-mail for instant access..." name="Enter your E-mail" class="txtinput" />
</form>
</div>
<div class="mail_rig"></div>
</div>
</div>
<div class="arrow_area">
<div class="left_arr"></div>
<div class="cen_but">
<span class="cen_text"><sup class="red">*</sup>We value your privacy and would never share your information.</span><br>
<input type="submit" class="button" name="submit" align="middle"/>
</div>
<div class="rig_arr"></div>
</div>
</form>
In order to override a <form> submitting data with the button you must:
A. Assign an id to the first form (in demo #form1)
B. Add the following attributes to the button:
Replace type="button" with type="submit"
Add formmethod="post" (or get)
Add formaction="https://httpbin.org/post" (The value is a live test server)
Add form="form1" (The value is the id of the targeted <form>)
Demo
This demo submits to a live test server, look for the form data in the JSON sent as the response to verify that it works
<div class="mail_area">
<div class="mail">
<div class="mail_lef"></div>
<div class="mail_cen">
<form id='form1' action="">
<input type="text" value="Enter your E-mail for instant access..." name="Enter your E-mail" class="txtinput" onfocus="if(this.value==this.defaultValue)this.value=''" onblur="if(this.value=='')this.value=this.defaultValue" />
</form>
</div>
<div class="mail_rig"></div>
</div>
</div>
<div class="arrow_area">
<div class="left_arr"></div>
<div class="cen_but">
<span class="cen_text"><sup class="red">*</sup>We value your privacy and would never share your information.</span>
<form action="">
<input type="submit" class="button" name="submit" formmethod="post" formaction="https://httpbin.org/post" form="form1">
</form>
</div>
<div class="rig_arr"></div>
</div>

Problems with the date attribute in HTML5

I have this code that I am building for my internship. I am trying to use the "date"input type in my code to add a pop up calender, however it isn't working. I have look at numerous websites, but i have yet to find someone who is having this problem. Any ideas on how to make this work? Here is my code:
<body>
<h1> Time Logging Form</h1>
<form method="post" id='datetime'>
<div class="form-row" id='datacell'>
<div class="editor-cell">
<input type="date" id="date">
</div>
<div class="editor-cell">
<input placeholder="Time in 00:00" type="text" id="timein">
</div>
<div class="editor-cell">
<input placeholder="Time out 00:00" type="text" id="timeout">
</div>
</div>
<input type="submit" value="+" id='plus'>
<input type="submit" value="submit" id='submit'>
</form>
</body>
What exactly you want to do with data attributs? When you run this html code in your browser, the calendar appears:
https://jsfiddle.net/6w5b5r5h/
<body>
<h1> Time Logging Form</h1>
<form method="post" id='datetime'>
...
</form>
</body>

HTML Submit Button not firing when form filled

I have a new login page which is not submitting. :(
If I click the button and the required fields are not entered, it fires me back the errors, but as soon as they're filled and I try to submit it does nothing.
The page is live at https://www.safewise.co.nz/trainwise/login
The code
<form action="login.php" method="post" name="logForm" id="logForm" class="styled_form">
<?php if(isset($redirectURL) && !empty($redirectURL)) { ?><input type="hidden" id="redirect" name="redirect" value="<?php echo $redirectURL; ?>" /><?php } ?>
<div>
<p id="login-title">Login</p>
<input name="userEmail" type="email" class="validate[required]" id="userEmail" placeholder="Email"<?php if(isset($enteredEmail) && !empty($enteredEmail)){echo ' value="'.$enteredEmail.'"';} ?> required /><span class="form_hint">Email Address</span>
<input name="userPwd" type="password" class="validate[required]" placeholder="Password" id="userPwd" required /><span class="form_hint">Password</span>
<div class="login-checkbox"><input type="checkbox" name="remember" id="remember" style="vertical-align:middle;" /> <label for="remember">Remember Me</label></div>
<p><input name="doLogin" type="submit" id="doLogin" value="Continue" class="form-button" /></p>
<div id="forgot"><p>Register</p><p>Forgotten Password?</p>
</div>
</form>
<div id="forgotPass" class="reveal-modal">
<div class="modal-header"><h3>Forgot Password</h3></div>
<div class="modal-body" style="text-align:center;">
<form action="login.php" method="post" name="forgotForm" id="forgotForm" >
<p style="margin-bottom:4px;"><em style="font-size:small;color:#3A3A3A">Enter your email address below to receive your new password.</em></p>
<p><input name="rstEmail" type="text" class="validate[required]" id="rstEmail" placeholder="john#example.com" size="25" /> <input name="doReset" type="submit" id="doReset" value="Reset" class="form-button" /></p>
</form>
</div>
<a class="close-reveal-modal">×</a>
</div>
The weird thing is as soon as I remove this code it works.
<div id="forgotPass" class="reveal-modal">
<div class="modal-header"><h3>Forgot Password</h3></div>
<div class="modal-body" style="text-align:center;">
<form action="login.php" method="post" name="forgotForm" id="forgotForm" >
<p style="margin-bottom:4px;"><em style="font-size:small;color:#3A3A3A">Enter your email address below to receive your new password.</em></p>
<p><input name="rstEmail" type="text" class="validate[required]" id="rstEmail" placeholder="john#example.com" size="25" /> <input name="doReset" type="submit" id="doReset" value="Reset" class="form-button" /></p>
</form>
</div>
<a class="close-reveal-modal">×</a>
</div>
Any suggestions?
Where is that div located in the page? It is incorrect to have a form inside a form. And so your code may work when you remove the div above because you've taken out the second form.
Consider having them as two separate entities instead of nested.
Are these forms nested? You cannot have nested forms. You can have multiple forms in a page, just as long they're not nested.
Here's some ref on it http://www.w3.org/MarkUp/html3/forms.html
I was missing a closing div
<div id="forgot">
<p>Register</p>
<p>Forgotten Password?</p>
Needs a closing div at end
<div id="forgot">
<p>Register</p>
<p>Forgotten Password?</p>
</div>

CSS, not sure how to move things around

I'm trying to remove the message box and I want to move the e-mail box to the right of the name, so that it all fits into the top bar.
I have tried removing the message box through the html code, but when I do, I get errors and it doesn't function properly.
I assume I have to remove something in the PHP because it's obviously not able to find the missing html code, but as I don't understand PHP I don't know what to remove.
this is the html code for the subscribe button
<div class="subscribe">
<div class="containerContact">
<div id="contactFormContainer">
<div id="contactForm">
<div class="loader"></div>
<div class="bar"></div>
<form action="mail.php" class="contactForm" name="cform" method="post">
<div class="input_boxes">
<p><label for="name">Name</label><span class="name-missing">Please enter your name</span><br />
<input id="name" type="text" value="" name="name" />
</p>
<p>
<label for="e-mail">E-mail</label><span class="email-missing">Please enter a valid e-mail</span><br />
<input id="e-mail" type="text" value="" name="email" />
</p>
<p><label for="message">Message</label><span class="message-missing">Say something!</span><br />
<textarea id="message" rows="" cols="" name="message"></textarea>
</p>
</div>
<input class="submit" type="submit" name="submit" value="Submit Form" onfocus="this.blur()" />
</form>
</div>
<div class="contact"></div>
</div>
</div>
<!-- this is the overlay which hides the rest of the website when the Subscribe button is pressed. -->
<div id="backgroundPopup"></div>
</div>
I can't post more than one link, so here is a text dump to the PHP and CSS for the subscribe button
any help would be much appreciated!!