Hi I have run this code and its working well but when i click on submit button it doesn't show page isn't available . how do I get page isn't available after clicking submit button
<
html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content ="width=device-width, initial-scale=1.0">
<meta http-equiv="X-UA-Compatible" content="ie=edge">
<title> practice</title>
</head>
<body>
<h1><b>Welcome to the your page.</b></h1>
<form action="/" name="myForm" method="post" onsubmit="return validateForm()">
<div id="name">
What is your name?:
<input type="text" name="fname" placeholder="Required" required>
<span class ="formerror"></span>
</div>
<input type="button" name="mybutton" value="Submit" >
strong text
</form>
</body>
</html>
CodePudding user response:
I don't know what did you really mean by "get page isn't available". But to make the form submit correctly you have to replace
<input type="button" name="mybutton" value="Submit" >
with this:
<input type="submit" value="Submit">
The input type should be submit
. Not button
.
Hope this helps.
CodePudding user response:
you can replace
<form action="/" name="myForm" method="post" onsubmit="return validateForm()">
to
<form action="#" name="myForm" method="post" onsubmit="return validateForm()">
Hope it works:)
CodePudding user response:
Try this code
<input type="submit" name="mybutton" value="Submit" >