|
Posted by mantrid on 10/12/06 20:55
Can anyone see why the checkbox in the code below doesnt get ticked when the
textbox is changed
***This javascript function is called in the textbox's onchange event to
check it when it is changed*****
<script type="text/JavaScript">
function changed(x){
document.getElementById(x).checked=true;
}
</script>
******This php function determine whether the check box is shown or not
(actually does more than this but ive slimed down the code) and has the
javascript function in the onChange event of the echoed textbox
function editable($edfield,$unedfield,$xtratext,$selquest){
if($unedfield!==''){
echo $xtratext."<input type='text' class='BodyText' style='WIDTH:
85%' name='".$edfield."' onChange='changed(".$selquest.")>'
value='".$unedfield."'><br>" ;
}else{
echo '';
}
}
************The code below displays the check box to be ticked and the text
box (or blank) fron the execution of the php function (editable)*********
<input name="changed[]" type="checkbox" id="<?php echo $QuestionIndex; ?>"
value="<?php echo $QuestionIndex; ?>">
<?php editable($groupcount,'question',$Question,1,'') ?>
I suspect it could be due to using a javascript function in php function.
I'm not sure if this is allowed. If anyone can see what wrong Id be very
grateful
Thank Ian
Navigation:
[Reply to this message]
|