Get ready for BLACK FRIDAY shopping starting in

Forums

This topic is locked

client-side dynamic dependent list box and insert

Posted 02 Aug 2002 15:54:57
1
has voted
02 Aug 2002 15:54:57 Sharon Burkey posted:
Hiya

Got a form with 3 client-side dynamic dependent list boxes which is working wonderfully - except that some users see the initial value of the child boxes and dont use the drop down list to select - is there any way to add a 'please select' option to the initial value, bearing in mind that this is a dynamic dependent list?

UD4/IIS/2000



Edited by - polgara on 02 Aug 2002 16:19:40

Replies

Replied 02 Aug 2002 19:32:31
02 Aug 2002 19:32:31 aegis kleais replied:
Just do a javascript check using selectedIndex.

ie, upon form submission, call a function that checks each dropdown.

ie.

function checkme(){
if (document.all.selectBoxName.selectedIndex == 0) {
alert("please make a selection on dropbox1";
return false;
}
}

it's MSIE compat code, as that I personally don't support NN. selectedIndex starts at 0 which is the first entry in the drop down box.

Aegis Kleais
New Media Web Developer
(DWMX : IIS5.1 : SQL2K : WXP : ASP[VB/JS])

Reply to this topic