By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
459,377 Members | 1,660 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 459,377 IT Pros & Developers. It's quick & easy.

select box error

100+
P: 110
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<=count($option_vals);$i++){
?>
select_opt[<?= $i ?>] = '<?= $option_vals[$i-1] ?>';
<?
}
$option_vals[]="";
?>[/PHP]
May 3 '08 #1
Share this Question
Share on Google+
2 Replies


acoder
Expert Mod 15k+
P: 16,027
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.
May 3 '08 #2

acoder
Expert Mod 15k+
P: 16,027
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.
May 3 '08 #3

Post your reply

Sign in to post your reply or Sign up for a free account.