0

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?

2
Contributors
4
Replies
5
Views
7 Years
Discussion Span
Last Post by muralikalpana
0

Just put multiple="multiple" inside select tag

Edited by kk_pbr: n/a

0

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?

0

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

Edited by kk_pbr: n/a

0

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

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.