Results 1 to 3 of 3

Thread: Build string, with javascript call & passing parameters

  1. #1

    Thread Starter
    Frenzied Member StrangerInBeijing's Avatar
    Join Date
    Mar 2005
    Location
    Not in Beijing
    Posts
    1,666

    Resolved Build string, with javascript call & passing parameters

    driving me bonkers...keep getting javascript errors no matter what combination of quotes and double quotes I use...

    Code:
    echo "<td><textarea onclick=edit_text('0','$value'); name='".$value."' id='".$value."' class='err_box'></textarea></td>";
    Last edited by StrangerInBeijing; Jul 26th, 2008 at 07:47 PM.
    Install and Configure Eclipse For both Java and PHP development
    Accessible Ajax/jQuery Forms Degrade gracefully with JavaScript Disabled

  2. #2
    WiggleWiggle dclamp's Avatar
    Join Date
    Aug 2006
    Posts
    3,527

    Re: Build string, with javascript call & passing parameters

    instead of using echo, just escape the php code and use html:
    PHP Code:
    ?>
    <td><textarea onclick="edit_text('0','<?php echo $value?>'); name='<?php echo $value?>' id='<?php echo $value?>' class='err_box'></textarea></td> 
    <?php ;
    My usual boring signature: Something

  3. #3

    Thread Starter
    Frenzied Member StrangerInBeijing's Avatar
    Join Date
    Mar 2005
    Location
    Not in Beijing
    Posts
    1,666

    Re: Build string, with javascript call & passing parameters

    yeah, that should do it. got into bad habbit with all this echo stuff.
    Install and Configure Eclipse For both Java and PHP development
    Accessible Ajax/jQuery Forms Degrade gracefully with JavaScript Disabled

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width