0

I recently started HTML and made my first Website. I made bunch of lines of codes, and the last line is: <input type="submit" name="register" value="Register" action="Registered.html">. I wanted to this submit button named as "Register" to get me to the my "Registered.html" file but something isn't right. The button shows up, and it's valued as "Register" but `action="Registered.html" doesn't work. I hope you understand me, if you can, fix this for me.

1
  • action="Registrered.html" is something you should put on a <form>. Add an <a> element to your button. Commented Jun 29, 2017 at 8:07

4 Answers 4

2

The form element takes the action attribute, not the input:

<form action="Registered.html">
    <input type="submit" name="register" value="Register">
</form>
Sign up to request clarification or add additional context in comments.

Comments

0
<form action="/action_page.php">
  First name:<br>
  <input type="text" name="firstname" value="Mickey">
  <br>
  Last name:<br>
  <input type="text" name="lastname" value="Mouse">
  <br><br>
  <input type="submit" value="Submit">
</form> 

notice the action is at the form..

refer https://www.w3schools.com/html/tryit.asp?filename=tryhtml_form_submit

Comments

0

In general form elements are used to send data to a server. It wraps around the elements which specifies the data, input or button elements, for instance. If you add a name and a value attribute to your input and button elements, you will send this name-value-pair to your server.

If you don’t need to send any (additional) data to your server, just use anchor elements:

<a href="Registered.html">Register</a>

Comments

0
<form>

<input type="submit" formaction="Registered.html" value="Register">
</form>

The formaction attribute of the input tag is not supported in Internet Explorer 9 and earlier versions.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.