kya
kya

Reputation: 1828

Link inside a button doesnt work on any browser

I would to create a link inside a button. I understand that a normal HTML link button works with all other browsers except for internet explorer. I added some javascript, but now the link isn't working in browser. My javascript skills are not good at all as I am still learning.

<tr>
        <td>&nbsp;</td>
        <td><input type="submit" value="Submit" />
        <input type="reset" value="Clear and Reset" />
        <input type="button" value="Return To Term" onClick="javascript:location.href = commute.php?clickedletter=<?php echo $clickedterm ;?>;" /></td>

Upvotes: 1

Views: 70

Answers (4)

blogresponder
blogresponder

Reputation: 43

<tr>
    <td>&nbsp;</td>
    <td><input type="submit" value="Submit" />
    <input type="reset" value="Clear and Reset" />
    <input type="button" value="Return To Term" onClick="javascript:location.href='commute.php?clickedletter=<?php echo $clickedterm ;?>';" /></td>

you must use quotes.

Upvotes: 0

Dmitry  Skryabin
Dmitry Skryabin

Reputation: 1636

You must to enclose the string in single quotes:

<input type="button" value="Return To Term" onClick="javascript:location.href = 'commute.php?clickedletter=<?php echo $clickedterm ;?>';" />

Upvotes: 1

Saravana
Saravana

Reputation: 40672

You need to place the URL inside quotes:

<input type="button" value="Return To Term" onClick="javascript:location.href = 'commute.php?clickedletter=<?php echo $clickedterm ;?>'" /></td>

Upvotes: 2

cornelb
cornelb

Reputation: 6066

onClick="location.replace('commute.php?clickedletter=< ?php echo $clickedterm;?>'" /></td>

Upvotes: 0

Related Questions