hello..


i am trying to do select multiple options of dropdown box. when i am select each option then appear textbox for each option. how to do?

Just put multiple="multiple" inside select tag

no man.....whenever i select option in dropdown then appear textbox. if i select two options from dropdown then appear two textboxes. is it clear my problem?

Result: To Create textbox on selection of multiple item of dropdown
call this function on form submission..

function elementcnt(frm)
{
var len=frm.selloc.options.length;/*frm is form name */
var count=0;
for(var i=0;i<len;i++)
	{
	if (frm.selloc.options[i].selected)
        count++;
	}
	if(count>5)
	{
	alert("You can select five localities");
	return false;
	}
	else
	return true;

}

now add following code to resulting php page(to where form action is specified)

<?php
 if (isset($_POST['locsubmit']))// your submit button
	{
	$val=count($_POST['selloc']);//your dropdoen
	
	for($i=0;$i<$val;$i++)
	{
		echo "<h3>".$_POST['selloc'][$i]."</h3><br/>";
		
?>
	<input name="dropdown[]" value="<? echo $_POST['selloc'][$i]; ?>" type="text" /><br />
<?php		
	}
	} 
?>

By
Chintan & KK_pbr

actually my problem is there is one product and having multiple sizes.
now sizes are in dropdownlist having multiple select option.
for example there is options in dropdown like this. "size1","size2","size3".....like so on.
now i am selecting "size1" and "size3" then automatically display two textboxes below like product(size1)price,product(size3)price

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.