select box error

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • SSG001
    New Member
    • Oct 2007
    • 110

    select box error

    Ii'm fetching names from the table and storing it in the option_vals array and in the names
    are like below
    product 1*10's xyz
    product 1/10 abc
    product 0.5nos hah

    i get error fot this is it because f the characters in the names of the product
    i'm creating this selct box from ajax

    [PHP]select_opt = new Array();
    select_opt[0]="--Select--";
    <?
    for($i=1;$i<=co unt($option_val s);$i++){
    ?>
    select_opt[<?= $i ?>] = '<?= $option_vals[$i-1] ?>';
    <?
    }
    $option_vals[]="";
    ?>[/PHP]
    Last edited by acoder; May 3 '08, 10:21 AM. Reason: Added code tags
  • acoder
    Recognized Expert MVP
    • Nov 2006
    • 16032

    #2
    As a full member now, you should know that we expect your code to be posted in [CODE] tags (See How to Ask a Question).

    This makes it easier for our Experts to read and understand it. Failing to do so creates extra work for the moderators, thus wasting resources, otherwise available to answer the members' questions.

    Please use the tags in future.

    MODERATOR.

    Comment

    • acoder
      Recognized Expert MVP
      • Nov 2006
      • 16032

      #3
      Originally posted by SSG001
      Ii'm fetching names from the table and storing it in the option_vals array and in the names
      are like below
      product 1*10's xyz
      product 1/10 abc
      product 0.5nos hah

      i get error fot this is it because f the characters in the names of the product
      i'm creating this selct box from ajax
      Yes, it's the single quote. Escape the quotes in the option values.

      Comment

      Working...