Form GET and redirect possible? - forms

I am having trouble figuring out how to set the form to submit a string to an affiliate but also redirecting the user to my own hosted thank you page. I am using the GET method to submit the string.
this is a very dumbed down version of my form
<form action="http://xxxxx.com/api/post.ashx" method="get">
<div>
<label ><span>First Name <font style="color: red;">*</font></span></label>
<input type="text" name="First" value="" maxlength="128" class="form-text required" />
</div>
<div >
<label ><span>Last Name <font style="color: red;">*</font></span></label>
<input type="text" name="Last" value="" size="60" maxlength="128" class="form-text required" />
</div>
<div >
<label ><span>Phone Number <font style="color: red;">*</font></span></label>
<input class="form-text" type="text" maxlength="14" name="phone1" id="phone1" value="">
</div>
</div>
<input class="form-submit" type="submit" id="edit-submit" name="op" value="Submit" />
</div></form>

If I understand your problem right, iframe is a kinda solution here.

Related

Mailto function is not working in Mobile view responsive

hey here is the code whenever my site is converted into the mobile view then mailto function is not working? can anyone suggest to me a solution to how he is works in mobile-view?
<form id="myForm" action="mailto:syedali6097#gmail.com" method="post" enctype="text/plain">
<h2>Win</h2>
<input name="name" type="text" placeholder="Enter Name">
<br><br>
<input name="subject" type="text" placeholder=" Subject">
<br><br>
<!-- <label>Email:-</label> -->
<input name="email" type="text" placeholder="Enter Email">
<br><br>
<input name="number" type="number" placeholder=" Enter Phone Number">
<br><br>
<p class="text-center">Fave Vape Flavour:-</p>
<textarea type="text" name="Description" size="50" rows="5" placeholder="Type Message"></textarea>
<br><br>
<input type="submit" value="Send" onclick="myFunction()">
<input type="reset" value="Reset">
</form>

How to push 'Remember me' to next line in Bootstrap 4

<link href="https://stackpath.bootstrapcdn.com/bootstrap/4.3.1/css/bootstrap.min.css" rel="stylesheet"/>
<form class="form-inline">
<label class="sr-only">Email</label>
<input
type="text"
class="form-control mb-2 mr-sm-2"
placeholder="Email"
/>
<label class="sr-only">Password</label>
<input
type="password"
class="form-control mb-2 mr-sm-2"
placeholder="Password"
/>
<button type="submit" class="btn btn-dark mb-2">Sign In</button>
<div class="form-check mb-2 mr-sm-2">
<input
class="form-check-input"
type="checkbox"
id="inlineFormCheck"
/>
<label class="form-check-label" for="inlineFormCheck">
Remember me
</label>
</div>
</form>
How to push the checkbox and 'Remember me' label to the next line, just below the Email label? I used line break after the Sign In button but it's not working.
One way would be to move checkbox outside .form-inline class, because it uses display: flex and flex-flow: row, which keeps all child elements in a single line.
<link href="https://stackpath.bootstrapcdn.com/bootstrap/4.3.1/css/bootstrap.min.css" rel="stylesheet"/>
<form>
<div class="form-inline">
<label class="sr-only">Email</label>
<input
type="text"
class="form-control mb-2 mr-sm-2"
placeholder="Email"
/>
<label class="sr-only">Password</label>
<input
type="password"
class="form-control mb-2 mr-sm-2"
placeholder="Password"
/>
<button type="submit" class="btn btn-dark mb-2">Sign In</button>
</div>
<div class="form-check mb-2 mr-sm-2">
<input
class="form-check-input"
type="checkbox"
id="inlineFormCheck"
/>
<label class="form-check-label" for="inlineFormCheck">
Remember me
</label>
</div>
</form>

condition field password (Password Protection)

I created a webform (Registration) Via phpform.org but I want make a condition for a field (Password) Like that (if password field is equal to 'test' then show Submit field )
<li id="li_2" >
<label class="description" for="element_2">Name </label>
<span>
<input id="element_2_1" name= "element_2_1" class="element text" maxlength="255" size="8" value=""/>
<label>First</label>
</span>
<span>
<input id="element_2_2" name= "element_2_2" class="element text" maxlength="255" size="14" value=""/>
<label>Last</label>
</span>
</li> <li id="li_1" >
<label class="description" for="element_1">Password </label>
<div>
<input id="element_1" name="element_1" class="element text medium" type="text" maxlength="255" value=""/>
</div>
</li>
<li class="buttons">
<input type="hidden" name="form_id" value="677911" />
<input id="saveForm" class="button_text" type="submit" name="submit" value="Submit" />
</li>
</ul>
</form>
<div id="footer">
Generated by pForm
</div>
</div>
<img id="bottom" src="bottom.png" alt="">
</body>
Please how can I do that ?
You may use jQuery:
$(".buttons").hide();
$("#element_1").keyup(function () {
if ($(this).val() == "test") {
$(".buttons").show();
} else {
$(".buttons").hide();
}
});
See it working here: http://jsfiddle.net/7UtHW/.

I cant get my mailto contact form to work

I have tried to make a contact form in a modal window. I thought I had done everything correctly but when I click send, I don't receive the email. Can anybody please show me where I'm going wrong?
Thanks very much in advance. Merry Xmas!
<!-- Modal -->
<div id="myModal" class="modal hide fade" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true">
<div class="modal-header">
<button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button>
<h3 id="myModalLabel">Contact McGregor Beauty</h3>
</div>
<div class="modal-body">
<form id="contact" method="post" action="mailto:aka_pipsqueak#msn.com">
Your Name <input class="input-xlarge" type="text" placeholder="Please write your name here" required>
<br />
Your Email <input class="input-xlarge" type="email" placeholder="Please enter your email address here" required><br />
Phone(Optional) <input class="input-large" type="number" placeholder="Add a telephone number"><hr />
<label><strong>Treatments of Interest</strong></label>
<label class="checkbox">
<input type="checkbox" value="Waxing & Tinting">Waxing & Tinting
</label>
<label class="checkbox">
<input type="checkbox" value="Massage">Massage
</label>
<label class="checkbox">
<input type="checkbox" value="Reflexology">Reflexology
</label>
<label class="checkbox">
<input type="checkbox" value="Manicure/Pedicure">Manicure & Pedicure
</label>
<label class="checkbox">
<input type="checkbox" value="MLD">MLD
</label>
<br />
<label><strong>Your Questions/Comments</strong></label>
<textarea rows="2" style="width:500px" type="text" required></textarea>
<div class="modal-footer">
<button class="btn btn-primary" type="submit" data-dismiss="modal" aria-hidden="true">Send</button>
</div>
</form>
what mail server are you using?
where is the server side code used to handle the http request of the form?
Just having a form in html isn't going to do anything, and an action of mailto: is not correct, nor would you want to do this because this email address can be seen in the markup and will be spammed until you close it.
what programming language are you planning to use?
Here's a basic example you can follow using php:
http://www.w3schools.com/php/php_mail.asp

I have two forms on a page but the submit button is submitting both forms

Hi I have two forms on a page, one is a small newsletter sign up form and the other is a larger event booking form. when the large booking form is submitted it submits the small newsletter form aswell. think it has something to do with the action url.
Here is the page code:
<script type="text/javascript"><!--
function validate(f){
var regex = /^\s*$/i;
for(var i=0; i<f.elements.length; i++){
if(regex.test(f.elements[i].value)){
alert("Please fill in all fields.");
f.elements[i].focus();
return false;
}
}
if(f.user_email.value.indexOf('#',0)==-1 || f.user_email.value.indexOf('.',0)==-1)
{
alert("You must provide a VALID email address.");
f.user_email.focus();
return false;
}
return true;
}
//--></script>
<div id="eventform" />
<form action="/Booking?ename=testevent&edate=19%20October%202011&submitform=yes" method="post" onsubmit='return validate(this);'>
<fieldset class="fieldset">
<div class="leftform">
<label for="booking_name">Event: </label><br class="nobr" />
<input name="booking_name" type="text" id="booking_name" value="testevent" />
</div>
<div class="rightform">
<label for="event_date">Date: </label><br class="nobr" />
<input name="event_date" type="text" id="event_date" value="19 October 2011" />
</div>
<div class="clear"></div>
<div class="leftform">
<label for="user_name">Name: </label><br class="nobr" />
<input name="user_name" type="text" id="user_name" />
</div>
<div class="rightform">
<label for="organisation">Organisation: </label><br class="nobr" />
<input name="organisation" type="text" id="organisation" />
</div>
<div class="clear"></div>
<div class="leftform">
<label for="address">Address: </label><br class="nobr" />
<input name="address" type="text" id="address" />
</div>
<div class="rightform">
<label for="postcode">Postcode: </label><br class="nobr" />
<input name="postcode" type="text" id="postcode" />
</div>
<div class="clear"></div>
<div class="leftform">
<label for="user_telephone">Contact Number: </label><br class="nobr" />
<input name="user_telephone" type="text" id="user_telephone" />
</div>
<div class="rightform">
<label for="user_email">Email Contact: </label><br class="nobr" />
<input name="user_email" type="text" id="user_email" />
</div>
<div class="clear"></div>
<br />
<hr />
<h3>Attendees</h3>
<p>Please list the name(s) and email address(s) of those you wish to book a place at the above event.</p>
<div class="leftform">
<input placeholder="Name" name="attendee1" type="text" id="attendee1" />
</div>
<div class="rightform">
<input placeholder="Email Address" name="attendee_email1" type="text" id="attendee_email1" />
</div>
<div class="clear"></div>
<div class="leftform">
<input placeholder="Name" name="attendee2" type="text" id="attendee2" />
</div>
<div class="rightform">
<input placeholder="Email Address" name="attendee_email2" type="text" id="attendee_email2" />
</div>
<div class="clear"></div>
<div class="leftform">
<input placeholder="Name" name="attendee3" type="text" id="attendee3" />
</div>
<div class="rightform">
<input placeholder="Email Address" name="attendee_email3" type="text" id="attendee_email3" />
</div>
<div class="clear"></div>
<div class="leftform">
<input placeholder="Name" name="attendee4" type="text" id="attendee4" />
</div>
<div class="rightform">
<input placeholder="Email Address" name="attendee_email4" type="text" id="attendee_email4" />
</div>
<div class="clear"></div>
<div class="leftform">
<input placeholder="Name" name="attendee5" type="text" id="attendee5" />
</div>
<div class="rightform">
<input placeholder="Email Address" name="attendee_email5" type="text" id="attendee_email5" />
</div>
<div class="clear"></div>
<br />
<hr />
<h3>Invoice Details</h3>
<p>Please give details of where the invoice should be sent.</p>
<label for="invoice_name">Name: </label><br class="nobr" />
<input name="invoice_name" type="text" id="invoice_name" /><br />
<label for="invoice_address">Address: </label><br class="nobr" />
<input name="invoice_address" type="text" id="invoice_address" /><br />
<label for="invoice_postcode">Postcode: </label><br class="nobr" />
<input name="invoice_postcode" type="text" id="invoice_postcode" /><br />
<p>Once we have received your booking form the person booking and those attending will receive a confirmation email confirming your places at the event and an invoice will be issued.
If you have any questions please do not hesitate to contact.</p>
</fieldset>
<br />
<input id="bookingform_submit" class="submitform" type="submit" value="Submit" />
<br /><br />
</form>
</div>
</div>
</div>
<div class="clear"></div>
</div></div>
<!--/content-->
<!--footer-->
<div id="outer-footer">
<div id="footer">
<div class="footer-1">
<h6>Get in touch...</h6>
<ul>
<li>Suite 124-128 Baltic Chambers,50 Wellington Street Glasgow G2 6HJ.</li>
<li><span>Tel:</span> 0141 248 1242</li>
<li><span>Fax:</span> 0141 221 1911</li>
<li><span>Email Us:</span>info#tis.org.uk </li>
</ul>
</div>
<div class="footer-2">
<h6>Join our newsletter...</h6>
<ul>
<li>Hear about the latest event and courses.</li>
<script type="text/javascript"><!--
function validate(f){
var regex = /^\s*$/i;
for(var i=0; i<f.elements.length; i++){
if(regex.test(f.elements[i].value)){
alert("Please fill in all fields.");
f.elements[i].focus();
return false;
}
}
if(f.user_email.value.indexOf('#',0)==-1 || f.user_email.value.indexOf('.',0)==-1)
{
alert("You must provide a VALID email address.");
f.user_email.focus();
return false;
}
return true;
}
//--></script>
<li>
<form action="./&submitform=yes" method="post">
<span class="input_space">
<input name="user_name" id="user_name" type="text" align="left" onblur="if(this.value=='')this.value='Your Name';"
onfocus="if(this.value=='Your Name')this.value='';" value="Your Name" />
</span>
<span>
<input name="user_email" id="user_email" type="text" align="left" onblur="if(this.value=='')this.value='Your Email Address';"
onfocus="if(this.value=='Your Email Address')this.value='';" value="Your Email Address" />
</span>
<input id="newsletterform_submit" type="submit" value="" class="submit-2" />
</form>
I dont think it is submitting the form twice, i think that the variable "submitform" = yes is being set by both, so when you click through to the large form it thinks that form 2 has been submitted also - but in reality it hasn't... you probably want to check that the form has really been submitted using the $_POST variables.