Multiple selection html dropdownlist
Posted: Mon Jul 06, 2009 3:05 am
hi i want to use html drop down list with multiple selection option
i want to access this DrpEmployee drop down list in javascript for validations some people said me to use the following code to access the dropdown list
here count is nothing but number of selected items.
the problem is i also want to access the DrpEmployee in php . can you specify the code to access the DrpEmployee selected items
Code: Select all
<form name="myform">
<select multiple="multiple" name="DrpEmployee" style="width: 173px">
<option>1</option>
<option>2</option>
<option>3</option>
<option>4</option>
<option>5</option>
<option>6</option>
<option>7</option>
</select>
<input type="submit" name="submit" value="submit" onclick="return Validate(this.form)" />
</form>
Code: Select all
function Validate(frm)
{
var count = 0
for (var i=0, len=frm.DrpEmployee.options.length; i<len; i++)
{
if (frm.DrpEmployee.options[i].selected)
count++;
}
the problem is i also want to access the DrpEmployee in php . can you specify the code to access the DrpEmployee selected items