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
196 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
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
843 views
+1 vote
1 answer

How can i create simple register form using html and css?

Html5 contains lots of elements using which ...READ MORE

answered Jan 31, 2020 in HTML by Niroj
• 82,720 points
2,949 views
0 votes
1 answer

How to align a <div> to the middle (horizontally/width) of the page?

Hello Kartik, position: absolute and then top:50% and left:50% places the top edge ...READ MORE

answered Apr 23, 2020 in HTML by Niroj
• 82,720 points
191 views
0 votes
1 answer

unable to load image file using <img> tag

This error means that file was not ...READ MORE

answered Oct 7, 2020 in HTML by Niroj
• 82,720 points
2,354 views
0 votes
1 answer

How do I give text or an image a transparent background using CSS?

In order to ensure that your image ...READ MORE

answered Feb 8 in HTML by Rahul
• 8,980 points
73 views
0 votes
0 answers

What is &amp used for

Is there any difference in the behavior ...READ MORE

May 17 in HTML by Kichu
• 19,040 points
12 views
0 votes
1 answer

How blockchain hides it's HTML source?

When you click View Source, you see ...READ MORE

answered Jul 17, 2018 in Blockchain by Shashank
• 10,400 points
482 views
0 votes
2 answers

Define a SQL query? What is the difference between SELECT and UPDATE Query? How do you use SQL in SAS?

HI.. SQL is Structured Query Language, which is ...READ MORE

answered Aug 8, 2020 in PHP by anonymous
4,450 views
0 votes
1 answer

Vertically centering text in a div

Try this code: .smallUnitBox { ...READ MORE

answered Sep 3, 2018 in Blockchain by digger
• 26,720 points
246 views
0 votes
1 answer

Using Post and Get for Embedded System Communication

Twitter would be a great place to ...READ MORE

answered Sep 4, 2018 in IoT (Internet of Things) by anonymous2
• 4,280 points
290 views
webinar REGISTER FOR FREE WEBINAR X
Send OTP
REGISTER NOW
webinar_success Thank you for registering Join Edureka Meetup community for 100+ Free Webinars each month JOIN MEETUP GROUP