www.webdeveloper.com
Results 1 to 2 of 2

Thread: Passing Value In A Hidden Field

  1. #1
    Join Date
    Oct 2008
    Posts
    9

    Passing Value In A Hidden Field

    Hello everyone!

    The following code is working ok, BUT I need to get rid of the pID value in the string and move it to a hidden field. Could someone tell me how to do it please?

    Thank you in advance for the help.

    Code:
    <script language="javascript">
    <!--
    document.write('<?php echo '<a href="javascript:popupWindow(\\\'' . tep_href_link(FILENAME_POPUP_PICTURE, 'pID=' . $products_id . '&pic=' . $pics ) . '\\\')">'
     . tep_image($small_pics, addslashes($products_name), 75, 75, 'hspace="2" vspace="2"') . '<br>' . '' . '</a>'; ?>');
    //-->
    </script>

  2. #2
    Join Date
    Nov 2006
    Location
    Oakland
    Posts
    500
    First of all, you have no reason to use the document.write();

    You could just output the string through PHP
    <?php echo '<a href="javascriptopupWindow(\\\'' . tep_href_link(FILENAME_POPUP_PICTURE, 'pID=' . $products_id . '&pic=' . $pics ) . '\\\')">'
    . tep_image($small_pics, addslashes($products_name), 75, 75, 'hspace="2" vspace="2"') . '<br>' . '' . '</a>'; ?>

    Just echo the string wherever you would like the HTML string to appear in your web page.

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

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



Recent Articles