listbox validation(Urgent)
-
I want validate listbox. Items adding to the listbox should be not greater than 5 How can I do this onblur Thanks
-
I want validate listbox. Items adding to the listbox should be not greater than 5 How can I do this onblur Thanks
Can u please explain in detail what exactly u want say by this: "Items adding to the listbox should be not greater than 5" ???
-
I want validate listbox. Items adding to the listbox should be not greater than 5 How can I do this onblur Thanks
oNCLICK OF BUTTON EVENT , CALL JAVASCRIPT AND PASS NO OF LISTITEMS.
Btn.Attributes.Add("onclick","return chk("+ list.Items.Count +");"); Function chk(count) { if(count>5){alert('Failed');return false;}else{return true;} }
bEST rEGARD pATHAN---------------------------------------------------
-
I want validate listbox. Items adding to the listbox should be not greater than 5 How can I do this onblur Thanks
javascript function: function fun(id) { var obj = document.getElementById(id); var cnt = obj.options.length; var checked = 0; for (var i = 0; i < cnt; i++) { if (obj.options[i].selected) checked++; } if (checked > 5) { alert('more than 5 selection'); obj.focus(); } } ################################### Server side: ListBox1.Attributes.Add("onblur", "fun('" + ListBox1.ClientID+ "');");