I know this is 'old stuff', but I am new to this and very frustrated- I am trying to pass a variable to a new url via an html onclick event, and failing. I have found several posts about it but the code posted in those posts does not work when I try it. I have struggled mightly with this.
Here is my code: first an echo of two versions of the onclick statement, and two versions of the actual button code. The echos from the two versions appear identical, but the first button with no variable works while the second using a variable results in no action. Can anyone point me in the direction of a solution? I suspect there is some simple principal I am missing relating to parsing strings.
<?php
echo "window.location.href='ManageTitles.php?dog=2'";
echo "\n" ;
echo "window.location.href='ManageTitles.php?dog={$row_rsDogsowned['idDogInfo']}'";
?>
<form methd="POST" Name="form3" action="<?php echo $editFormAction; ?>">
<input type="button"
value="works"
onclick="window.location.href='ManageTitles.php?dog=2'" />
<input type=button
onclick="window.location.href='ManageTitles.php?dog={$row_rsDogsowned['idDogInfo']}'"
value="fails" />
</form