Forum Moderators: open
I have two forms on a single ASP page.The two forms having one list boxes each. For instance, take one listbox as a category and other as sortby. Both of them contain few entries like business,general......( in category listbox) and Name,Company,fname, lname(in sortby list box) respectively.
I wish to refresh the same page again and again. I mean to say if the user select business categories form category listbox then the later part of the page of the content is refresh and the upper page contain the same as mentioned above except firstlist box heading change to " BUSINESS" .
Is it possible? if yes then how? Can anyone provide the code for the same.
Thanks in advance!
yes, the thing you want to do is possible. two ways are possible: with javascript (works only on selective browsers) or with a server-side script (asp/php etc.). this can be even combined (makes sense on a very large listings for example).
with javascript you use the onclick event of the first listbox and then you clear all elements of the second listbox and fill them with the selected entries.
with a server-side script, you simply check which item was selected in the first listbox and you re-display the page with the according values in the second one. you can create a second submit-button you can check it it was pressed on the server-side to check wether a selection in the first list was made or the user submitted an entry of the second listbox.
if you're willing to use asp, then checkout the asp forum on webmasterworld.
- hakre.
<select id="catview" onchange="this.form.submit();" size="1" name="catview"><option value="0" selected>All
Categories</option><option value="1">Business</option>
<option value="2">Personal</option><option value="3">Quicklist</option></select>
<b>with javascript you use the onclick event of the first listbox and then you clear all elements of the second listbox and fill them with the selected entries.</b>
Would you like to eloborate what you wish to convey in the above mentioned paragraphs of yours. For your conveinence, All the lisbox are independent to each other.
With Thanks!
kid