/    Sign up×
Community /Pin to ProfileBookmark

help me with that quotations…

print(“<td align=”center” width=”40″ style=”position:static”><select name=”kat$i” onChange=”check2(‘kat$i’,$i)”><option value=”1″>Evet</option><option value=”2″ selected>Hayir</option></select></td>”);

here is the code segment written in php and here is the function it is sent to :

function check2($id,$l)
{

print(“<script type=’text/javascript’>”);
print(“if(document.getElementById(“$id”).value==”1″)
{
hide(“acik$l”);
hide(“maz$l”);
hide(“maz9$l”);
}
if(document.getElementById(“$id”).value==”2″)
{
show(“acik$l”);
show(“maz$l”);
show(“maz9$l”);
});
print(“</script>”);
}

The problem is that when I click EVET on combobox,the fields on the right must be disabled.My algorithm is right cause I wrote this in javascript and it worked.So I think there are some problems with the quotation.I will be glad if u help.

to post a comment
PHP

3 Comments(s)

Copy linkTweet thisAlerts:
@Bootsman123Jun 15.2005 — If you had a working script in javascript then why don't you compare the output of this with your original script?
Copy linkTweet thisAlerts:
@guessauthorJun 15.2005 — Man I think U got me wrong.There is no output.The problem is I have a fully working code written in javascript and I have to convert some part of it to php cause I need to post a variable inside the for loop.I tried but couldnt convert the code because I think there are some mistakes with the quotations.I will put the fully working javascript code here for u to look.Inside the for loop there are 4 rows consisting the variable "i".I have to post this variable to another page for an array so I have to write it with PHP.I tried lots of things but the function couldnt be called or there is a problem with the function's inside.I hope u can help me.here is the javascript code :

[B]<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"

"http://www.w3.org/TR/html4/loose.dtd">

<html>

<head>

<title>Untitled Document</title>

<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">

<script type="text/javascript">

function check()

{

if(document.kutay.kat.checked==false)

{

document.kutay.maz1.style.visibility="hidden"

document.kutay.maz2.style.visibility="hidden"

}

else if(document.kutay.kat.checked==true)

{

document.kutay.maz1.style.visibility="visible"

document.kutay.maz2.style.visibility="visible"

}

}

function hide(DivID)

{

document.getElementById(DivID).disabled=true;

}

function show(DivID)

{

document.getElementById(DivID).disabled=false;

}

function check2(id,l)

{



if(document.getElementById(id).value=='1')
{
hide('acik'+l+'');
hide('maz'+l+'');
hide('maz9'+l+'');
}
if(document.getElementById(id).value=='2')
{
show('acik'+l+'');
show('maz'+l+'');
show('maz9'+l+'');
}
if(document.getElementById(id).value=='3')
{
hide('acik'+l+'');
}
if(document.getElementById(id).value=='4')
{
show('acik'+l+'');
}

}

function createtable(j)

{

document.write("<form name='kutay'>");

document.write("<table border='1' width='980' style='font-size: 8pt; font-family: Tahoma'; 'position:static'>");

for(var i=0;i<j;i++)

{

document.write("<tr>");

document.write("<td align='center' width='34' style='position:static'>&nbsp;<b>1</b></td>");

document.write("<td align='center' width='188' style='position:static'>&nbsp;<b>Kutay Kalkan</b></td>");

document.write("<td align='center' width='189' style='position:static'>&nbsp;<b>Taahhüt grubu</b></td>");

document.write("<td align='center' width='190' style='position:static'>&nbsp;<b>Muhasebe elemani</b></td>");

document.write("<td align='center' width='40' style='position:static'><select name='kat"+i+"' onChange='check2("kat"+i+"","+i+")'><option value='1'>Evet</option><option value='2' selected>Hayir</option></select></td>");

document.write("<td align='center' width='60' style='position:static'><input type='radio' name='mazeret"+i+"' id='maz"+i+"' value='3' onClick='check2("maz"+i+"","+i+")'></td>");

document.write("<td align='center' width='51' style='position:static'><input type='radio' name='mazeret"+i+"' id='maz9"+i+"' value='4' onClick='check2("maz9"+i+"","+i+")'></td>");

document.write("<td align='center' width='188' style='position:static'><input type='text' size='27' id='aciklama"+i+"' name='acik"+i+"'></td>");

document.write("</tr>");

}

document.write("</table>");

document.write("</form>");

}

</script>

</head>

<body>

<?

print("<table width="980" height="21" border="1" style="font-size: 8pt; font-family: Tahoma">");

print("<tr><td width="3" align="center"><b>No</b></td>");

print("<td align="center" width="188"><b>Adi_Soyadi</b></td>");

print("<td align="center" width="189"><b>Grubu</b></td>");

print("<td align="center" width="190"><b>Görevi</b></td>");

print("<td align="<center" width="35"><b>Katilim</b></td>");

print("<td align="center" width="53"><b>Mazeretsiz</b></td>");

print("<td align="center" width="51"><b>Mazeretli</b></td>");

print("<td align="center" width="188"><b>Aciklama</b></td></tr></table>");

?>

<script type="text/javascript">

createtable(10);

</script>

</body>[/B]
Copy linkTweet thisAlerts:
@NogDogJun 15.2005 — Change...

});

...to...

}");
×

Success!

Help @guess spread the word by sharing this article on Twitter...

Tweet This
Sign in
Forgot password?
Sign in with TwitchSign in with GithubCreate Account
about: ({
version: 0.1.9 BETA 5.19,
whats_new: community page,
up_next: more Davinci•003 tasks,
coming_soon: events calendar,
social: @webDeveloperHQ
});

legal: ({
terms: of use,
privacy: policy
});
changelog: (
version: 0.1.9,
notes: added community page

version: 0.1.8,
notes: added Davinci•003

version: 0.1.7,
notes: upvote answers to bounties

version: 0.1.6,
notes: article editor refresh
)...
recent_tips: (
tipper: @AriseFacilitySolutions09,
tipped: article
amount: 1000 SATS,

tipper: @Yussuf4331,
tipped: article
amount: 1000 SATS,

tipper: @darkwebsites540,
tipped: article
amount: 10 SATS,
)...