I ve a query for form tag

0 votes
Sir I've used one <form> tag and used action="sourceurl.com" In it as a property.
And I've used 2 buttons between the opening and closing tag of <form>, one for logon and another for cancel. So, when i click on the logon button it simply redirects me to that link but when i click on the cancel button it also redirects me to that link. But i want don't want to get redirected when i click on the cancel button
Aug 17, 2020 in HTML by Saksham
• 120 points
478 views
Hello @saksham,
Please share your code so that i can find out what is the problem behind ur error.

1 answer to this question.

0 votes
That might be because button inside form by default is of type "submit". change the type of button and try.

<button (click)="...">...</button>  ---------> this is type="submit"

chnage to

<button (click)="..." type="...">...</button> search and change the type of button as required.

Hope it helps!
answered Nov 2, 2020 by sindhu

Related Questions In HTML

0 votes
1 answer

How to set a border for an HTML div tag?

 you can use border-width:2px; border-style:solid; border-color:black; or as shorthand border: 2px solid ...READ MORE

answered Aug 4, 2022 in HTML by Deepak
• 940 points
287 views
0 votes
0 answers

How to do calculation in PHP using a csv file for retrieving data?

Morning, I have a csv file and i ...READ MORE

Feb 11, 2020 in HTML by anonymous
• 140 points
1,202 views
0 votes
0 answers

What is a form control in HTML?

I was using Twitter Bootstrap which has ...READ MORE

Jul 4, 2022 in HTML by Tejashwini
• 3,780 points
214 views
0 votes
0 answers

How to make a simple modal pop up form using jquery and html?

I've read the jQuery tutorials, but I'm ...READ MORE

Jul 24, 2022 in HTML by Ashwini
• 5,390 points
307 views
0 votes
0 answers

How to use <form:form> </form:form> TAG using HTML in Spring MVC?

How to utilize the <form:form> </form:form> In Spring MVC ...READ MORE

Jul 26, 2022 in HTML by Ashwini
• 5,390 points
193 views
0 votes
0 answers

Should I use <i> tag for icons instead of <span>?

To display icons, both Facebook's HTML and ...READ MORE

Aug 16, 2022 in HTML by