Board index   FAQ   Search  
Register  Login
Board index PHP PHP General

NEED HELP!!! "php with javascript"

General discussions related to php

Moderators: macek, egami, gesf

NEED HELP!!! "php with javascript"

Postby holeyh » Wed Jan 22, 2003 1:16 pm


Hi,
i'm trying to affect a php variable from a db to a javascript variable and it seems like it doesn't work...

Does anyone have an idea??

Thanks
Patrice
---------------------------


<SCRIPT LANGUAGE=javascript>
<!--
function CompareToList(){

to_select = <? '.$row[Question_Secrete_value ].' ?>;

for(i=0;i<document.form1.QuestionSecrete.length;i++){
strText = document.form1.QuestionSecrete[i].value;
if(to_select==strText){
document.form1.QuestionSecrete.options[i].selected = true;
break;
}
}
}
//-->
</SCRIPT>
holeyh
New php-forum User
New php-forum User
 
Posts: 2
Joined: Wed Jan 22, 2003 12:56 pm
Location: montreal

Postby Redcircle » Wed Jan 22, 2003 10:54 pm

to_select = <? '.$row[Question_Secrete_value ].' ?>;

needs to be

to_select = <? echo $row[Question_Secrete_value ]; ?>
User avatar
Redcircle
Moderator
Moderator
 
Posts: 830
Joined: Tue Jan 21, 2003 10:42 pm
Location: Michigan USA


Return to PHP General

Who is online

Users browsing this forum: landi, shmideos and 1 guest

Sponsored by Sitebuilder Web hosting and Traduzioni Italiano Rumeno and antispam for cPanel.