Submit form to another page within the same domain - forms

How to submit form to another page within the same domain which has no form ID or name?
Form that needs to submit to another page:
<form id="login_form" action="roundcube" method="post">
<div class="input-req-login">
<label for="user">Email Address</label>
</div>
<div class="input-field-login icon username-container">
<input name="_user"
id="rcmloginuser"
autofocus="autofocus"
placeholder="Enter your email address."
class="std_textbox"
type="text"
tabindex="1" required>
</div>
<div style="margin-top:30px;" class="input-req-login">
<label for="pass">Parola</label>
</div>
<div class="input-field-login icon password-container">
<input name="_pass"
id="rcmloginpwd"
placeholder="Enter your email password."
class="std_textbox"
type="password"
tabindex="2" required>
</div>
<div class="controls">
<div class="login-btn">
<button type="submit"
onclick="document.getElementByName("form").submit()"
tabindex="3">Autentificare</button>
</div>
Target form:
<form name="form" action="./" method="post">
<input type="hidden" name="_token" value="543e98f5e6cc25841fc0df79cb939590">
<input type="hidden" name="_task" value="login">
<input type="hidden" name="_action" value="login">
<input type="hidden" name="_timezone" id="rcmlogintz" value="_default_">
<input type="hidden" name="_url" id="rcmloginurl" value="">
<table>
<tbody>
<tr>
<td class="title">
<label for="rcmloginuser">Utilizator</label>
</td>
<td class="input">
<input name="_user"
id="rcmloginuser"
size="40"
autocapitalize="off"
autocomplete="off"
type="text">
</td>
</tr>
<tr>
<td class="title">
<label for="rcmloginpwd">Parolă</label>
</td>
<td class="input">
<input name="_pass"
id="rcmloginpwd"
size="40"
autocapitalize="off"
autocomplete="off"
type="password">
</td>
</tr>
</tbody>
</table>
<p class="formbuttons">
<input type="submit"
class="button mainaction"
value="Autentificare" />
</p>
</form>

Ok, I have taken a look at your sites now. This is actually quite simple.
I guess what you are trying to do is to set up a personalized web site to log in so you can give your own look and feel. And roundcube, I guess that is a standard mail system you have installed?
Well the problem is that roundcube not only sends user name and password. If you look at the HTML code you also see:
<input type="hidden" name="_token" value="5b6a757df5eee91fa7ee7171466b8b2a">
<input type="hidden" name="_task" value="login">
<input type="hidden" name="_action" value="login">
<input type="hidden" name="_timezone" id="rcmlogintz" value="_default_">
<input type="hidden" name="_url" id="rcmloginurl" value="">
All these are hidden values that are automatically sent with the log in POST. You probably need to add the last 4 of them.
There might be a big problem for you though. The first one called _token I have a theory that this is a randomized string that the server will require you to provide. I can be wrong but if I am correct you will not be able to do what you want. The reason for having this random string is to prevent users from posting log ins from other forms (that is if I am correct)
Maybe it is possible for you to turn off this randomized string in the roundcube admin settings? If not I think you don't have an easy way to proceed unless you want to dig into the code of round cube.
Edit: I just tried submitting the original form without the _token and it does not work. so unfortunately you are out of luck this time.

I am not quite sure I understand your question, but I guess you are writing a new page and want to post to another page. What if you do like this?
<form id="login_form" action="http://webmail.mysite.com/roundcube/" method="post">

Related

Modx can't send message with FormIt

I try to send a message from my contact form, but I don't receive any message.
I use QuickEmail to test it, and I receive a message on my mailtrap account. I guess the problem is from the contact form (right now I am local).
//Chunk
[[!FormIt?
&hooks=`spam,email,redirect`
&emailTpl=`MyEmailChunk`
&emailTo=`test#gmail.com`
&redirectTo=`123`
]]
<form action="[[~[[*id]]]]" method="post" class="form">
<input class="mb-4" type="text" placeholder="NAME" id="name" />
<input class="mb-4" type="text" placeholder="EMAIL" id="email" />
<textarea class="mb-4" type="text" placeholder="MESSAGE" id="message"></textarea>
<button class="btn btn-success">SUBMIT</button>
</form>
//Second chunk
Name: [[+input-name]] <br/>
Email: [[+input-email]] <br/>
Message: <br />
[[+input-textare]]
<br/>
Agreement check: [[+input-checkbox]]
Do you use SMTP? This maybe important also, please enable it. It offen depends on server settings.so If I understood this properly and you really use local server - all that makes sense also.
You are missing the name parameter, which is required.
<input name="input-name" class="mb-4" type="text" placeholder="NAME" id="name" />
https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input#htmlattrdefname

When submit I want to receive the message on my mail (duplicate)

Here's my code for my new website
<div class="single_contant_left">
<form action="#" id="formid">
<!--<div class="col-lg-8 col-md-8 col-sm-10 col-lg-offset-2 col-md-offset-2 col-sm-offset-1">-->
<div class="form-group">
<input type="text" class="form-control" name="name" placeholder="first name" required="">
</div>
<div class="form-group">
<input type="email" class="form-control" name="email" placeholder="Email" required="">
</div>
<div class="form-group">
<input type="text" class="form-control" name="subject" placeholder="Subject" required="">
</div>
<div class="form-group">
<textarea class="form-control" name="message" rows="8" placeholder="Message"></textarea>
</div>
<div class="">
<input type="submit" value="Submit" class="btn btn-primary">
and when I want someone who clikck on submit, i want to receive the message on my personal mail.
Any idea ?
Thanks
First you will need to make sure you know where you want to send the email from. Which computer should send the email? The server where you submit the form, or the client computer on which the web browser of the user is running?
If you want the server to send the email, you will need to write server-side code which will handle the form submit when the user clicks on the submit button. Inside that server-side code, you might use your own SMTP, or you can use a server-side mailer API, there are tons of possibilities and we are not aware of what server-side technology you are using, if any.
Of course you can send the emails from the browser as well, using a client-side mailer API.

Why am I getting an error with the SSL handshake 525 with Formspree on my Github pages site here http://volunteer.tcffo.org/#cta?

<!-- Contact Form -->
<form id="contact-form" method="post" action="https://www.formspree.io/tcffo.volunteers#gmail.com">
<div>
<input type="text" name="Name:" id="name" placeholder="Name">
<br>
<input type="email" name="Email:" id="email" placeholder="Email Address" />
<br>
<div><textarea name="Message:" id="help" placeholder="Message"></textarea></div>
<br>
<input type="submit" value="Send">
<input type="hidden" name="_next" value="//tcffo.github.io" />
</div>
</form>
Code is here.
https://github.com/tcffo/tcffo.github.io
You're using the wrong Formspree URL there. It should https://formspree.io/, without the www., that's why.

Not able to specify "amount" per payment request on PayPal HTMLButton

I am trying to integrate with PayPal using the "HTML Buttons" approach.
The checkout flow is rather simple,
user clicks "Buy Now" -> transferred to PayPal -> payment processed -> returned to the site.
Based on the item that the customer wants to "Buy Now", the "amount" in the submitted form will vary, and I am unable to get PayPal to accept the value I am sending. I always see a text input which is empty when redirected to PayPal.
I tried hosted and unhosted buttons but still not able to see the desired effect.
hosted button HTML example:
<form action="https://www.sandbox.paypal.com/cgi-bin/webscr" method="post" target="_top">
<input type="hidden" name="cmd" value="_s-xclick">
<input type="hidden" name="hosted_button_id" value="HOSTEDBTNVALUE">
<input type="image" src="https://www.sandbox.paypal.com/en_GB/SG/i/btn/btn_buynowCC_LG.gif" name="submit" alt="PayPal – The safer, easier way to pay online!" style="border: 0;">
<img alt="" src="https://www.sandbox.paypal.com/en_GB/i/scr/pixel.gif" style="border: 0; width: 1; height: 1;">
<input type="text" readonly="true" name="item_name" value="Test PayPal integration payment">
<div class="form-group" id="amount_field">
<label class="control-label col-md-2" for="amount">Amount</label>
<div class="col-md-5">
<input type="text" id="amount" name="amount" value="100" aria-describedby="amount_info_0" class="form-control"><span id="amount_info_0" class="help-block">Real</span></div>
</div>
<div class="form-group" id="txnRef_field">
<label class="control-label col-md-2" for="txnRef">Transaction Ref</label>
<div class="col-md-5">
<input type="text" id="txnRef" name="txnRef" value="8d724ad470af4d9d91d49f84068c4bab" aria-describedby="txnRef_info_0" class="form-control"><span id="txnRef_info_0" class="help-block">Required</span></div>
</div>
<input type="hidden" name="currency_code" value="SGD">
</form>
The "amount" above is a text input at the moment because this is my integration testing page, in the actual application it will be a hidden/readonly input embedded in the form.
Here is the unhosted button example code:
<form action="https://www.sandbox.paypal.com/cgi-bin/webscr" method="post" target="_top">
<input type="hidden" name="cmd" value="_s-xclick">
<input type="hidden" name="encrypted" value="-----BEGIN PKCS7-----ReallyLongKey-----END PKCS7-----">
<input type="image" src="https://www.sandbox.paypal.com/en_GB/SG/i/btn/btn_buynowCC_LG.gif" name="submit" alt="PayPal – The safer, easier way to pay online!" style="border: 0;"><img alt="" src="https://www.sandbox.paypal.com/en_GB/i/scr/pixel.gif" style="border: 0; width: 1; height: 1;">
<input type="hidden" name="notify_url" value="https://myapplication.com/transaction/paypal/status">
<input type="hidden" name="currency_code" value="SGD">
<input type="hidden" name="custom" value="ad4a63e2f2f04b908ddb8e7c67f9c67a">
<input type="text" readonly="true" name="item_name" value="Test PayPal integration payment">
<div class="form-group" id="amount_field">
<label class="control-label col-md-2" for="amount">Amount</label>
<div class="col-md-5">
<input type="text" id="amount" name="amount" value="100" aria-describedby="amount_info_0" class="form-control"><span id="amount_info_0" class="help-block">Real</span></div>
</div>
<div class="form-group" id="txnRef_field">
<label class="control-label col-md-2" for="txnRef">Transaction Ref</label>
<div class="col-md-5">
<input type="text" id="txnRef" name="txnRef" value="ad4a63e2f2f04b908ddb8e7c67f9c67a" aria-describedby="txnRef_info_0" class="form-control"><span id="txnRef_info_0" class="help-block">Required</span></div>
</div>
</form>
I have screenshots below for the application page and what I see as a result on the PayPal payment page. Please excuse the lack of alignment and styling. This is meant to be a proof of concept before it is pretty.
my application test page for integration
paypal page where amount is expected to be fixed based on my request and not editable.
Not sure what I'm doing wrong here. Please help.
thanks.
I was able to get it going by making PayPal generate the button with the following settings:
1. Merchant account IDs: Use my primary email address [did not use secure merchant account ID]
2. unchecking the save button at PayPal checkbox. Also, in the html button generation interface, I clicked the link remove code protection which made the cmd value from _s-xclick to _xclick

How to submit form data with Zurb Foundation

I'm a beginner trying to set up my first form with Zurb Foundation, and I'm not able to find in the documentation the info on how to actually pass the data. It's just a basic contact form with name/email/message that I'd like sent to my email once people click the Submit button... and I don't know how to do that.
I apologize for the simple question, your help is greatly appreciated.
Zurb foundation is front end frame work for website design and development , if you want to submit the form or do server communications, please read some basics,
HTML form and input : http://www.w3schools.com/html/html_forms.asp
Submitting HTML form using Jquery AJAX :
Submitting HTML form using Jquery AJAX
AJAX - Send a Request To a Server : http://www.w3schools.com/ajax/ajax_xmlhttprequest_send.asp
The HTML part:
<form action="form_contact_process.php" method="POST" name="contact" id="contact">
<fieldset>
<legend>Contact form</legend>
<div class="row collapse">
<label for="name">Name</label>
<input type="text" name="name" id="name">
</div>
<div class="row collapse">
<label for="email">Email</label>
<input type="text" name="email" id="email">
</div>
<div class="row collapse">
<label for="phone">Phone</label>
<input type="text" name="phone" id="phone">
</div>
<div class="row collapse">
<label for="message">Message</label>
<textarea name="message" id="message" rows="5"></textarea>
</div>
<div class="row collapse">
<input class="button small large-12" type="submit" value="Submit">
</div>
</fieldset>
</form>
Then over at form_contact_process.php:
<?php
$name = $_POST['name'];
...
echo $name;