PDA

View Full Version : onclick problem using php


zuzupus
08-15-2003, 03:54 PM
hi,

when i am using onClick on input field and mixing php with onclick im getting javascript error,anbody help me in this situation

<input type="radio" name="ddir" value="<?=$r->sys_pk ?>" onclick="sqlDoTable($names);" id="dir<?=$r->sys_pk ?>" />
function sqlDoTable ($result) {
print "<table border=1 cellpadding=3 cellspacing=0>";

print "<tr>";
for ($i=0;$i < mysql_num_fields($result);$i++) {
print "<th>" . mysql_field_name($result, $i) . "</th>";
}
print "</tr>\n";

// Print table Content
for ($i=0;$i < mysql_num_rows($result);$i++) {
print "<tr>";

$row = mysql_fetch_row($result);
foreach ($row as $value) {
// Make sure 0's are displayed
if (is_numeric($value)) { $value = (int)$value; }

// Make sure table is displayed correctly
if (empty($value) && ($value !== 0)) { $value = "&nbsp;"; } else { $value = htmlspecialchars($value); }
print "<td>$value</td>";
}

print "</tr>\n";
}

print "</table>";
}

actully the problem is when i select some directory in this link http://server2.vitodesign.com/scripts/test.phtml i am getting Jscript error

if anybody help me out how i can print this tvalue exactly below these directories will be very helpful

thanks in advance

Spookster
08-15-2003, 04:18 PM
error = "javascriptError";

if(error == "javascriptError"){
alert("Post in Javascript Forum");
toForum = "JavaScript Programming";
}
else if(error == "phpError"){
alert("Post in PHP forum");
toForum = "PHP";
}

moveThread(toForum);



:D

Choopernickel
08-15-2003, 04:33 PM
zuzupus, if you could post the processed code (what's sent to the browser, grab it with View [''|'Page'|'Frame'] Source), I think we might be able to help you a bit more easily.

lord_raven
08-15-2003, 08:17 PM
Oops, I hit "new reply" instead of "new thread"

Garadon
08-15-2003, 08:24 PM
looking at your stuff it seems to me your trying to use php as client side language which is last I checked impossible.