PHP variables to Javascript problem

Status
This thread has been Locked and is not open to further replies. Please start a New Thread if you're having a similar issue. View our Welcome Guide to learn how to use this site.

ctky

Thread Starter
Joined
Nov 8, 2004
Messages
10
I am trying to code a radio button whereby when I click on the button, it will redirect me to another php file- CT1013.php.
At the same time, I want the $TID variable to be passed to CT1013.php.

I tried it but there is no respond whatsoever when I click on the radio button. However, if I do not use a php variable, it work fine.

Could someone please help me solve this and to alert me of any syntax error with the php scripts - especially with the quotes.


This is my Javascript:

<SCRIPT LANGUAGE="JavaScript">
function go(SelTrip1) {
window.location.href = SelTrip1;
}
</script>
.
.
.
then I have the following scripts in PHP :


<?php
ECHO'<td><input type="radio" name= SelTrip1" onClick="go(\'/ct1013.php?ST=\'\"'.$TID.'");"><TD>'.$TID.'</td><td>'.$RDESCP.'</td></tr>';
?>

Thank you and I would be most thankful if this can be solved.
 
Joined
Jul 8, 2002
Messages
14,681
PHP:
<?php
$var = "<td><input type=\"radio\" name=\"SelTrip1\" onclick=\"go('ct1013.php?ST=" . $TID . "');\"><td>" . $TID .  '</td><td>' . $RDESCP . '</td></tr>';
echo $var;
?>
 

ctky

Thread Starter
Joined
Nov 8, 2004
Messages
10
Thanks Brendandonhu, your revised code works wonderfully. I still have 60% done and rest assure I will be back...;-)
 
Status
This thread has been Locked and is not open to further replies. Please start a New Thread if you're having a similar issue. View our Welcome Guide to learn how to use this site.

Users Who Are Viewing This Thread (Users: 0, Guests: 1)

As Seen On
As Seen On...

Welcome to Tech Support Guy!

Are you looking for the solution to your computer problem? Join our site today to ask your question. This site is completely free -- paid for by advertisers and donations.

If you're not already familiar with forums, watch our Welcome Guide to get started.

Join over 807,865 other people just like you!

Latest posts

Staff online

Top