Send form to remote server - html

I want to use the service provided at http://zxing.org/w/decode.jspx with a custom form in my own site. I've written the following code:
<html>
<body>
<FORM action="http://zxing.org/w/decode.jspx" method="post">
<INPUT type="text" name="u" value="http://justinsomnia.org/images/qr-code-justinsomnia.png">
<INPUT type="submit" value="Send">
</FORM>
</body>
</html>
When I submit the form, I'd expect to see the results page with a "Decode Succeeded" message. Instead, I see the original remote form I'm trying to duplicate.
Can you spot what's wrong with my custom form?

<html>
<body>
<FORM action="http://zxing.org/w/decode" method="get">
<INPUT type="text" name="u" value="http://justinsomnia.org/images/qr-code-justinsomnia.png">
<INPUT type="submit" value="Send">
</FORM>
</body>
</html>
You should use get instead of the post method. You are posting to the wrong URL, post to http://zxing.org/w/decode. I checked it, it's working now.

Related

"action_page.php" in form error leads to Error 404

I want to create a form in HTML and I am leading it to the demo page, "action_page.php". When I press "Submit" it shows Error 404.
I tried changing the attribute up and down but it is still saying Error 404. Is this the right demo link? I double-checked. Can someone show how to fix this and some steps on what to do?
Here is the code I have put to make it clear to you:
<form action="action_page.php"
<input type="submit" value="Submit Survey"
</form>
In conclusion, how can I make the demo link "action_page.php" work? (HTML Answer)
<form action="action_page.php">
<input type="submit" value="Submit Survey">
</form>
Your code must be like that:
<form action="action_page.php" method="GET">
<input type="submit" value="Submit Survey">
</form>

What is "mailto:someone#example.com" in following HTML form example?

I am learning HTML from w3schools HTML Tutorial - The Best in Class Tutorial
I come across one HTML form example which sends an email.
Please note that currently neither do I nor w3schools is going for server side input processing, so you also don't think about server side processing while considering my question.
Below is the code of HTML example :
<!DOCTYPE html>
<html>
<body>
<h2>Send e-mail to someone#example.com:</h2>
<form action="mailto:someone#example.com" method="post" enctype="text/plain">
Name:<br>
<input type="text" name="name"><br>
E-mail:<br>
<input type="text" name="mail"><br>
Comment:<br>
<input type="text" name="comment" size="50"><br><br>
<input type="submit" value="Send">
<input type="reset" value="Reset">
</form>
</body>
</html>
Normally I see a .php or .asp filename in action attribute of a form but in above example it's mailto:someone#example.com.
I want to know what is it and why they have not used a .php or .asp file-name as they normally do?
Please someone explain me.
Thank You.
You are basically giving the users browser the job of handling the mailto request. The browser usually starts the users mail client and fills in the fields according to the input of your form.

HTML form POST shows server's reply

I have a simple HTML form.
<!DOCTYPE>
<html>
<body>
<center>
<form action="MYLINK" method="POST">
Tell your device what to do!<br>
<br>
<input type="radio" name="args" value="on">Turn the Light on.
<br>
<input type="radio" name="args" value="off">Turn the Light off.
<br>
<input type="submit" value="Do it!">
</form>
</center>
</body>
</html>
When the submit is clicked, the page redirects and Server's JSON reply is shown. I dont want that.
I added an IFRAME in the page and then added it as the form's target
<form action="MYLINK" method="POST" target="hidden-form">
...
</form>
<IFRAME style="display:none" name="hidden-form"></IFRAME>
Now the reply from server is not visible.

Why HTML "submit" not working?

I am making a Register - Login system in php/HTML and i have 3 php files now, in the first file (registering) worked FORM but in the second (login) not. The submit button don't do anything. What can be the problem?
<HMTL>
<HEAD><h1>Bejelentkezés</h1></HEAD>
<BODY>
<body background="http://wallpaperstock.net/minimal-gray-to-white-gradient_wallpapers_33797_1440x900.jpg"
<form action="afterlogin.php" method="post">
Felhasználónév: <input type="text" name="user2">
Jelszó: <input type="password" name="pass2">
<input type="submit" value="login">
</form>
</BODY>
</HMTL>
Try this...
<html>
<head><h1>Bejelentkezés</h1></head>
<body background="http://wallpaperstock.net/minimal-gray-to-white-gradient_wallpapers_33797_1440x900.jpg">
<form action="afterlogin.php" method="post">
Felhasználónév: <input type="text" name="user2">
Jelszó: <input type="password" name="pass2">
<input type="submit" value="login">
</form>
</body>
</html>
A lot of typo buddy...like HMTL..two body tags...plz do take care of what you write..and get some linting tool...
You have body tag two times in your code,please make it single and close tag is also not there,please add that.

Submit form as "multipart/form-data" but content-type is “application/x-www-form-urlencoded” on the server

I'm trying to submit a form that includes a file, I'm using enctype="multipart/form-data" but the request content-type is sent as “application/x-www-form-urlencoded”, this is the part of the code:
<div id="uploadTest" data-role="page" align="right">
<form id="uploadTestForm" action="/Upload" method="POST" enctype="multipart/form-data">
<input type="text" name="text" autofocus required>
<input id="ImageFile" type="file" data-clear-btn="false" name="image" accept="image/*" capture>
<button type="submit" data-theme="a">Upload</button>
</form>
</div>
This is a part of my HTML5 application that need to upload the file.
There is no JS code that run on submitting the form.
May you please help me find why I cannot submit the form as "multipart/form-data"?
I was able to find out what was the problem.
I just added data-ajax="false" to the form and now it is working.