In my HTML I've added the following:
<div>
<form action="https://ssl.somepage.pl/t2/" method="post"
id="form">
<input name="api_version" value="dev" type="hidden"/>
<input name="id" value="123456" type="hidden"/>
<input name="amount" value="320.00" type="hidden"/>
<input name="currency" value="PLN" type="hidden"/>
<input name="description" value="Płatność
za zamówienie 12345/2014" type="hidden"/>
<input name="control" value="202cb962ac59075b964b07152d234b70" type="hidden"/>
<input name="channel" value="248" type="hidden"/>
<input name="ch_lock" value="1" type="hidden"/>
<input name="firstname" value="John" type="hidden"/>
<input name="lastname" value="Smith" type="hidden"/>
<input name="email" value="john.smith#example.com" type="hidden"/>
<input name="type" value="0" type="hidden"/>
<input name="credit_card_store" value="1" type="hidden"/>
<input name="credit_card_customer_id" value="f9c6a4-25473-035b58-9daa"
type="hidden"/>
<input name="chk"
value="11ac1938ac47ddd53815b4aeb6230ab9fe4554d82ee11e39c41b9055f38f5c08"
type="hidden"/>
</form>
<p>
<button type="submit" form="form"
value="Submit">Pay</button>
</p>
</div>
Which, as I understand, should make post method, and open a new webpage.
However, nothing happens. Any idea why? I am using Angular2.
The submit button must be inside of the form tag.(Oops sorry didnt know that your method is also possible)
Try making it like these:
<div>
<form id="form" method="POST" action="your link">
. . . . .
<p>
<input type="submit" value="Pay">
</p>
</form>
</div>
The code is perfectly fine. I did cross verify it. I found the problem with the link you have put in the action attribute. I think the page doesn't exist or there is a problem with page. I added 'https://www.facebook.com' into the action attribute and it got redirected perfectly. So just check the link you have put.
The issue was caused by Angular2 Form changes. To enable default behaviour, I needed to add:
<form ngNoForm ... >
To allow normal behaviour
Related
I have another personal website I want to post my form to, see code
<form name="requestPrint" action="www.mysite1.com/set_var.cgi"
method="POST">
<input name="value" type="hidden" size="8" value="1">
<input type="hidden" name="page" value="mypage.html"/>
<input type="hidden" name="index" value="94"/>
<input type="submit" value ="Print">
</form>
However when the form posts it goes to www.mysite2.com/www.mysite1.com/set_var.cgi
Is there a way to point it to just www.mysite1.com/set_var.cgi?
You should try the following:
action="http://www.mysite1.com/set_var.cgi"
My input tag in a form is not showing the suggestions for previous entered values
<form target="temp" method="post" action="">
<input id="UserID" name="UserID" type="text" placeholder="User ID" autocomplete="on" spellcheck="false">
<input id="Password" type="password" placeholder="Password" spellcheck="false">
<input type="button" value='Submit' onclick="login();">
</form>
What is happening is:
I want it to be:
You can make most browsers display values previously entered in input fields by giving a name to the input.
Change first input to this:
<input id="UserID" name="UserID" type="text" placeholder="User ID" spellcheck="false">
UPDATE
Not sure what your onClick function is doing but...
Change type="button" to type="submit":
<input type="submit" value='Submit' />
I'm making a form which collect some data from a person and then use a simple mailto: to put it in their e-mail client like so (example):
<form method="post" action="mailto:email#address.com?subject=Stuff">
<p>Name: <input type="text" name="Name" placeholder="Number"></p>
<p>Address: <input type="text" name="Address" placeholder="Number"></p>
<p>City: <input type="text" name="City" placeholder="Number"></p>
<p>Comment: <input type="text" name="Comment" placeholder="Number"></p>
<p><input type="submit" value="SEND"></p>
</form>
It then comes out like this:
Name=Bob&Address=something&City=more&Comment=elsemore
but what I want is:
Name=Bob
Address=something
City=more
Comment=elsemore
or even better:
Name = Bob
Address = something
City = more
Comment = elsemore
Is it at all possible currently to do this just within HTML? HTML5 and Python is all I know (mostly only the basic parts too). Maybe someone could help me out with the proper code/script on this.
I did find some other posts on this but they are old and don't answer the question.
You need to set the Encryption Type (enctype="text/plain"):
<form method="post" action="mailto:email#address.com?subject=Stuff" enctype="text/plain">
<p>Name: <input type="text" name="Name" placeholder="Number"></p>
<p>Address: <input type="text" name="Address" placeholder="Number"></p>
<p>City: <input type="text" name="City" placeholder="Number"></p>
<p>Comment: <input type="text" name="Comment" placeholder="Number"></p>
<p><input type="submit" value="SEND"></p>
</form>
You could also write some stuff in Javascript and then work with the body parameter. But i wouldn't recommend this.
In most times, it is better to let the webserver handle the email communication.
Asp: http://www.codeproject.com/Tips/371417/Send-Mail-Contact-Form-using-ASP-NET-and-Csharp
Php: http://tangledindesign.com/how-to-create-a-contact-form-using-html5-css3-and-php/
I am banging my head for 2 days to integrate neteller into my website but could not get it,
Returned response in xml contain error saying Invalid merchantid/merchant key ,how can i get them?
<form method="post" action="https://test.api.neteller.com/netdirect">
<input type="text" name="version" value=" 4.1">
<input type="text" name="amount" size="10" value="3443" maxlength="10">
<input type="text" name="currency" value="USD" size="10" maxlength="3">
<input type="text" name="net_account" size="20" value="" maxlength="100">
<input type="text" name="secure_id" size="10" value="" maxlength="6">
<input type="hidden" name="merchant_id" value="43646">
<input type="hidden" name="merch_key" value="456453">
<input type="hidden" name="merch_transid" value="46436436" maxlength="50">
<input type="hidden" name="language_code" value="EN">
<input type="hidden" name="merch_name" value="fdghdfhgf">
<input type="hidden" name="merch_account" value="436346" maxlength="50">
<input type="hidden" name="custom_1" value="test123" maxlength="50">
<input type="hidden" name="custom_2" value="test123" maxlength="50">
<input type="hidden" name="custom_3" value="test123" maxlength="50">
<button type="submit" name="submit">Make Transfer</button>
</form>
At first You should not put your merchant credentials in hidden inputs for security reasons. Everyone can see your sensitive data. Make a POST on server side not client side.
merchant API key You can generate on merchant neteller panel in the Developer tab.
How do you change the value of a hidden form with the id's of text forms? I have something like the following:
<form name="form" action="file.php" method="post">
<input type="hidden" name="dessert" id="dessert" value="">
Favorite cake: <input type="text" name="cake" id="cake" onfocus="dessert.value=this.id"><br>
Favorite pie: <input type="text" name="pie" id="pie" onfocus="dessert.value=this.id"><br>
Favorite taffy: <input type="text" name="taffy" id="taffy" onfocus="dessert.value=this.id"><br>
<input type="submit value="Go."><br>
I'm pretty unfamiliar with html, so I'm having trouble changing the value of the hidden form with the id of the text input onfocus.
Your code works, you just have a syntax error.
<input="hidden" name="dessert" id="dessert" value="">
Should be:
<input type="hidden" name="dessert" id="dessert" value="">
notice the "type="
Works in Chrome: fiddle
Try:
<form name="form" action="file.php" method="post">
<input type="hidden" name="dessert" id="dessert" value="">
Favorite cake: <input type="text" name="cake" id="cake" onfocus="document.getElementById('dessert').value=this.id"><br>
Favorite pie: <input type="text" name="pie" id="pie" onfocus="document.getElementById('dessert').value=this.id"><br>
Favorite taffy: <input type="text" name="taffy" id="taffy" onfocus="document.getElementById('dessert').value=this.id"><br>
<input type="submit value="Go."><br>
Using the format:
onfocus="document.getElementById('dessert').value=this.id"
jsFiddle example