0

this is my first time using html and im already stuck..

this is my code generated by the program

<form id="form1" name="form1" method="post" action="">

    <label><span class="creamcustom">..</span> 

      <input type="submit" name="btnReadAles" id="btnReadAles" value="Read" />

    <span class="creamcustom">...... </span></label>

    <input type="submit" name="btnBuyAles" id="btnBuyAles" value="Buy Now" />

  </form>

now I want btn "btnReadAles" to link and open this page "read.html"

how do I do that, remember, I am still new so I do not know when to use eg. (btw, I dont even know what it means...

thnx

2 Answers2

0

Try this

<input type="submit" name="btnReadAles" id="btnReadAles" onclick='window.location.href="read.html"' value="Read" />

OR

<input type="submit" name="btnReadAles" id="btnReadAles" onclick='window.open("read.html")' value="Read" />

In FORM Action

<form action="read.html">
    <input type="submit" id="btnReadAles" value="Read">
</form>
Sridhar R
  • 20,190
  • 6
  • 38
  • 35
  • thank you, just for intrest sake, why 2 different methods for the same thing, when is it appropriate to use windows.open and window.location.href, how do they differ? –  Nov 07 '13 at 10:16
  • ist one open in same tab second one open in new tab.if hepls mean accept as answer – Sridhar R Nov 07 '13 at 10:17
  • i just tried the window.location.href, and it reloads the current webpage, however, the window.open DOES open the desired webpage –  Nov 07 '13 at 10:20
0

Wrap it within a form element

<form action="http://some site.com/read.html">
    <input type="submit" value="Go to SOME SITE">
</form>

For more info see THIS POST

Community
  • 1
  • 1
pratim_b
  • 1,160
  • 10
  • 29
  • could you just specify what does "wrap with a form element" mean? sorry if this is a stupid question... xD –  Nov 07 '13 at 10:12
  • For all your questions here are the answers http://www.w3schools.com/html/default.asp – pratim_b Nov 07 '13 at 10:19