Hi there,
I got some help from FAQ's, but now I am stuck at with a different problem.... Any help is greatly appreciated.
Design: An ASP page with 4 multi-select List boxes, populated from a database. User selection [OnClick event] in one list-box, dynamically updates the list boxes on the right...
I have a page that does this to some extent, by reloading the page with user input.
But the problem now is, Once the user makes a seleciton in one of the boxes, the page is automatically refreshed to update the other lists. But I want to allow multi-selection for users in each list-box.
One idea that I tried, but failed is
Basically, my idea is to submit onCllick, but ignore submit if the user is trying to make multiselect [by pressing Control or Shift key down]. But is not working..!!
Says error at 'onClick="CheckUserInput()"'
This is one of the unsuccessful approaches....
APPROACH 2:
Same above code, but take user input on Double click.
i.e.
For some reason, I couldn't get this to work either....
NOTE: the boxes need to be multi-select
Please advise if there is a way out of this or if there is a better approach.
Thanks a lot,
_Uday
I got some help from FAQ's, but now I am stuck at with a different problem.... Any help is greatly appreciated.
Design: An ASP page with 4 multi-select List boxes, populated from a database. User selection [OnClick event] in one list-box, dynamically updates the list boxes on the right...
I have a page that does this to some extent, by reloading the page with user input.
But the problem now is, Once the user makes a seleciton in one of the boxes, the page is automatically refreshed to update the other lists. But I want to allow multi-selection for users in each list-box.
One idea that I tried, but failed is
Code:
<SCRIPT language="JavaScript">
Function CheckUserInput()
{
// ignore if the user tries to make multi-selection
// by pressing Shift or Ctrl while clicking
if !((window.event.keycode = 16) or (window.event.keycode = 17))
{
document.frm1.submit();
return true;
}
}
</SCRIPT>
<form name="frm1" post="thispage.asp" method="post">
<select name="drug" MULTIPLE SIZE=10 onclick="CheckUserInput()">
<option value="1">1</option>
<option value="2">2</option>
...
</SELECT>
</form>
Basically, my idea is to submit onCllick, but ignore submit if the user is trying to make multiselect [by pressing Control or Shift key down]. But is not working..!!
Says error at 'onClick="CheckUserInput()"'
This is one of the unsuccessful approaches....
APPROACH 2:
Same above code, but take user input on Double click.
i.e.
Code:
<form name="frm1" post="thispage.asp" method="post">
<select name="drug" MULTIPLE SIZE=10 onDoubleclick="document.frm1.submit(); Return True;">
<option value="1">1</option>
<option value="2">2</option>
...
</SELECT>
</form>
For some reason, I couldn't get this to work either....
NOTE: the boxes need to be multi-select
Please advise if there is a way out of this or if there is a better approach.
Thanks a lot,
_Uday