Reply to Re: using javascript function in php function??

Your name:

Reply:


Posted by mantrid on 10/13/06 00:47

OK
I got it just a silly typo error in my function. It should be

echo $xtratext."<input type='text' class='BodyText' style='WIDTH: 85%'
name='".$edfield."[]' value='".$unedfield."'
onChange='changed(".$selquest.")'><br>" ;

or for a text area (later part of the function not shown)

echo $xtratext."<textarea class='BodyText' style='WIDTH: 98%'
name='".$edfield."[]'
onChange='changed(".$selquest.")'>".$unedfield."</textarea><br>";

Thanks all for your time

Ian

"mantrid" <ian.dandav@virgin.net> wrote in message
news:2ZxXg.9478$gO3.383@newsfe7-win.ntli.net...
> 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
>
>

[Back to original message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация