Form 'submit' button

my submit button submits without required info.
the link in the button is suppose to take you to a ‘thanks for submitting’ pg.

 <form><p>Pleas fill in a the following infomation.</p>
 <ul class="u-list1">
 <li>First Name &nbsp;&nbsp;<input required type="text"></li>
<li>Surname &nbsp;&nbsp;<input required type="text"></li>        
 <button type="submit"><a href="aftersub.htm">Submit</a></button>
</form>

the poblem is just the button. Thanks.

You need no <a> tag inside your button, instead you’d have to put the URL inside the action attribute of the <form> element:

 <form action="aftersub.htm"><p>Pleas fill in a the following infomation.</p>
 <ul class="u-list1">
 <li>First Name &nbsp;&nbsp;<input required type="text"></li>
<li>Surname &nbsp;&nbsp;<input required type="text"></li>        
 <button type="submit">Submit</button>
</form>
1 Like

@mmv1590 Instead of making a new <a> tag just give the button an href attribute. Hope that helps. Happy Coding! :smile:

1 Like