Ok so i want to make a button on my website that when you click it
it takes your to a diffrent html file E.x.
your on the website in index.html you click the button your get transfered to
test.html thank - Dat boi
Dec 22, 2016 12:36 AM
(This post was last modified: Dec 22, 2016 12:37 AM by ryan⚜.)
Code <FORM METHOD="link" ACTION="differentfile.html">
<INPUT TYPE="submit" VALUE="Button">
</FORM>
Couldn't you just add a href tag to the button element?
Nowadays? I'm just here for the nostalgia.
(Dec 22, 2016 12:36 AM)ryan⚜ Wrote: Code <FORM METHOD="link" ACTION="differentfile.html">
<INPUT TYPE="submit" VALUE="Button">
</FORM>
Thank you
Dec 22, 2016 02:26 PM
(This post was last modified: Dec 22, 2016 02:27 PM by Rushax.)
Pretty sure it shouldn't be done like Ryan suggested as it's a form sending nothing to another page.
Same applies for the anchor around a button as its seen as very bad practice.
If you're using a framework like Bootstrap, there's really simple ways to make this happen by using:
Code <a class="btn" href="link.html">Link</a>
If you're not using any frameworks, then you could just make your own styles for the element.
(Dec 22, 2016 02:26 PM)Rushax Wrote: Pretty sure it shouldn't be done like Ryan suggested as it's a form sending nothing to another page.
Same applies for the anchor around a button as its seen as very bad practice.
If you're using a framework like Bootstrap, there's really simple ways to make this happen by using:
Code <a class="btn" href="link.html">Link</a>
If you're not using any frameworks, then you could just make your own styles for the element. This. A form is not necessary. All you need is an anchor tag and some CSS to make it a button. If you're not using Bootstrap, it wouldn't be hard to wrap an anchor tag around the button.
Forms shouldn't be used for sending a user to another page for just a redirect. You only need a form if you're sending data through. Use an anchor tag like what the others have quoted above.
Whoaaaaa, seems a lot of hate is coming from this lol. Yes, it's better to do this as someone suggested.
<a class="btn" href="link.html">Link</a>
I posted that shit at 2am, relax people, you don't shoot the dude at burger king for accidentally putting onions on your burger..
(Dec 24, 2016 03:55 PM)ryan⚜ Wrote: Whoaaaaa, seems a lot of hate is coming from this lol. Yes, it's better to do this as someone suggested.
<a class="btn" href="link.html">Link</a>
I posted that shit at 2am, relax people, you don't shoot the dude at burger king for accidentally putting onions on your burger.. Not having a go at all lol, it's Xmas. Peace & love ✌
I think it's just better to say something so OP can know right okay, this works but its not really supposed to be done like this.
Happy Holidays 🤗
Im sure people reacted like that because that was a really obscure way to solve his problem lmao
(Dec 24, 2016 03:55 PM)ryan⚜ Wrote: relax people, you don't shoot the dude at burger king for accidentally putting onions on your burger..
...I didn't get that memo
all dis over a post asking for halp? im so confused
lol
DO NOT DEAL WITH THIS MEMBER
(Jan 14, 2017 12:50 AM)Jeffr3y Wrote: all dis over a post asking for halp? im so confused
lol
They're offering you 2 ways to do it.
Best option:
Code <a class="className" href="mylink.html">My Link</a>
and in the CSS...
Code .className{
padding:10px;
color:white;
background-color:black;
text-align:center;
margin:20px;
}
|