Hi ppl

yestday i posted a thread and that issue was solved, but a similar issue is raised again. this time,
1)i am populating the options(eg: base material, film, glass pane) in dropdown from database.
2)user selects a option, enters other details and click submit.
3)on clicking submit, all the info from the form is saved into another table in database.

now the issue is, on clicking submit, if the option chosen is base material, only base is getting posted.

aaah what cud be the reason??

i ll post the code snippet soon..until then can anyone help out here..

thanks

Recommended Answers

All 4 Replies

Make sure the value is in quotes if it contains a blank.

thanks chris

<select name="component" id="component" >
<option>..</option>
	<?php 

	while($rowComp = mysql_fetch_array($resComp))
	{
	echo "<option id=".$rowComp['id']." value=".($rowComp['name']).">".($rowComp['name'])."</option>";
	}
	?>
</select>

this is where i have the issue i guess, cos the options are getting populated n the 1st word gets printed. pls have a look at the code and suggest me how to get it to work..

thanks again..

If the value contains blanks then you lose whatever is after the blank. Try this:

echo "<option id=".$rowComp['id']." value=\"".($rowComp['name'])."\">".($rowComp['name'])."</option>";

hey chris thanks a ton that worked :)

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.