Why HTML "submit" not working? - html

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.

Related

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 does my input box not accept data on my website

I have a form to enable people to provide an email address but it wont allow any input. The site is www.pbadvisory.com.au and here is my HTML code:
<form action="mailto:jdoe#pbadvisory.com.au" method="get">
<input type="text" name="emailaddress" id="newsletter_email" />
<input type="submit" id="newsletter_subscribe" value="Subscribe" name="submit" />
</form>
any suggestions to fix would be appreciated
Just went through your site. Actually it is allowing to input the text. But the text color is white and background is white, so its invisible. Change the text color so you can see it.
You cannot use a mailto: as a form action. If you want a form that sends e-mail, it must be done server-side.
Try with following Changes!
<form action="MAILTO:jdoe#pbadvisory.com.au" method="post" enctype="text/plain">
<input type="text" name="emailaddress" id="newsletter_email" />
<input type="submit" id="newsletter_subscribe" value="Subscribe" name="submit" />
</form>
Form method should be 'post' not get. That's the reason for your problem. Any way here is the full code with email subject is also included.
<form method="post" action="mailto:youremail#youremail.com?Subject=Email Subject" enctype="text/plain">
E-mail:<input id="emailAddress" name="E-mail" type="text" maxlength="24" />
<input type="submit" value="Send Email" />
</form>
Hope it helped.
Update:
Just a note this is not the right way if you want users to get subscribe with your web site.

Send form to remote server

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.

Form is not appearing but its content does

I have this piece of code:
<div>
<form name='profileForm' id='profileForm' action='' method='get'>
<input type='submit' name='ProfileBtn' id='ProfileBtn' class='buttonC' value='My Profile' />
</form>
<br />
<form name='logoutForm' id='logoutForm' action='' method='get'>
<input type='submit' name='LogOutBtn' id='LogOutBtn' class='buttonC' value='Logout' />
</form>
</div>
When I render the above the "profileForm" does not appear (although the profileBtn DOES appear).
the seconed form has no problems, which is weird because they are both similar.
It's probably an easy question but I have no idea what's the problem.
This just happened to me using Chrome -- it was because I had a form within a form. It looks like Chrome just stripped out the <form> open and close tag because my form was within another form. When I moved one form outside of the other, then both <form> tags were rendered in the html as intended.
Crackermann was getting at this in his answer too.
It's hard to give a direct solution without seeing your full html, but I'm guessing this is your problem - you need to make sure your form is not within another form. Really simple example to illustrate this:
Form within another form, notice if you run this code in Chrome and inspect <form id="form2"> is not rendered:
<html>
<head></head>
<body>
<form id="form1">
<div>form within a form</div>
<form id="form2">
<input type="text" placeholder="name" /><br/>
<input type="text" placeholder="title" />
</form>
</form>
</body>
</html>
If you move form2 outside of form1, run the code in Chrome and inspect, then <form id="form2"> is rendered:
<html>
<head></head>
<body>
<form id="form1">
<div>form2 moved outside of form1</div>
</form>
<form id="form2">
<input type="text" placeholder="name" /><br/>
<input type="text" placeholder="title" />
</form>
</body>
</html>
well then somehow there was a weird problem with the forms, the button didn't show up because when i ran the website the the 'profileForm' just disappeared somehow (and didn't show up in the console).
what i did was adding a third Form before 'profileForm' which somehow solved this.
There is an unclosed HTML TAG like < form > in your code before these lines ,
Find and close that form
OR
just put </form> before your code.
Just put a empty form on top of your form.
Then all forms will be appear with form id
<form></form>
<form name='profileForm' id='profileForm' action='' method='get'>
<input type='submit' name='ProfileBtn' id='ProfileBtn' class='buttonC' value='My Profile' />
</form>
<form name='logoutForm' id='logoutForm' action='' method='get'>
<input type='submit' name='LogOutBtn' id='LogOutBtn' class='buttonC' value='Logout' />
</form>
Check that you don't an unclosed form element before your next form open.
If you do, browsers will generate the source without displaying the subsequent form open and form close pair.
Try viewing your Page Source
For Mac users
Option + Command + U
For Windows users
Ctrl + U
Then check for any unclosed <form> tag above your specified <form> tag and close it.
It works for me, hope it works for you too

DHL Tracking HTML Form?

Does anyone know if I can create an HTML Form to search the DHL tracking website?
http://www.dhl.co.uk/en/express/tracking.html
I have tried using the following but get the error 'down for maintenance':
<!DOCTYPE html>
<!--[if IE]>
<![endif]-->
<html><head><meta charset="utf-8" />
</head>
<body>
<form action="http://www.dhl.co.uk/content/gb/en/express/tracking.shtml?brand=DHL&AWB=1212121212" method="post">
<input type="submit" value="go" />
</form>
</body>
</html>
Will I have to use the API?
The following HTML tracking sample enables you to insert a single waybill number into a tracking field and submit the request via your existing web page. This link takes you to the DHL tracking screen, automatically populating the shipment information.
<html>
<head>
<title>DHL - Track By Tracking Number</title>
</head>
<body>
<form name="form1" method="get" action="http://www.dhl-usa.com/content/us/en/express/tracking.shtml?">
< input type=hidden name=brand VALUE="DHL">
<input type="text" name="AWB" size="10"><br>
<input type="submit" value="Submit"><br>
<input type="reset" value="Reset">
</body>
</html>
Big shout out to #WeezHard for dropping that form. I figured his solution is directed at DHL USA, so if you want a global DHL tracking form you can use the follow code.
<form name="form1" method="get" action="https://www.dhl.com/global-en/home/tracking/tracking-express.html?submit=1&tracking-id=" target="_blank">
<input type=hidden name=submit VALUE="1">
<input type="text" name="tracking-id" size="10" placeholder="Enter your DHL waybill number here..."><br>
<input type="submit" value="Track">
</form>
I modified #WeezHard codes to adapt Aramex courier tracking
<form name="form1" method="get" action="https://www.aramex.com/track/results?
ShipmentNumber=" target="_blank">
<input type="text" name="ShipmentNumber" size="11" placeholder="Enter your AWB"><br>
<input type="submit" value="Track">
<input type="reset" value="Reset">
</form>
feel free to use it! ;)