469,641 Members | 1,175 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,641 developers. It's quick & easy.

move selection to next box

We have all seen those web pages which feature a multiple <select> box on
the left, and an empty one on the right, and the user selects one or several
options from the left box, clicks a button, and those selections appear in
the right box.

Although I have seen these, I have never tried coding them before, until
now. I imagine that there is some client-side code involved, but because my
code will use ASP to do some stuff with the selections, I figured it was OK
to ask it here. Can someone direct me to some sample code for this?

I have searched on some ASP code sites, but haven't found anything, probably
because I don't know a short description for this kind of thing.
Jul 19 '05 #1
3 1631
well, you have two options, only one of which applies here in a Server Side
group.
That would be to have the selection of the first one cause a .submit() to
happen where you can read the value and limit the second selection box
results.

--
----------------------------------------------------------
Curt Christianson (Software_AT_Darkfalz.Com)
Owner/Lead Designer, DF-Software
http://www.Darkfalz.com
---------------------------------------------------------
...Offering free scripts & code snippits for everyone...
---------------------------------------------------------

"middletree" <mi********@htomail.com> wrote in message
news:e0**************@TK2MSFTNGP10.phx.gbl...
We have all seen those web pages which feature a multiple <select> box on
the left, and an empty one on the right, and the user selects one or several options from the left box, clicks a button, and those selections appear in
the right box.

Although I have seen these, I have never tried coding them before, until
now. I imagine that there is some client-side code involved, but because my code will use ASP to do some stuff with the selections, I figured it was OK to ask it here. Can someone direct me to some sample code for this?

I have searched on some ASP code sites, but haven't found anything, probably because I don't know a short description for this kind of thing.

Jul 19 '05 #2
I do better with sample code. Know of any I could look at?
"Curt_C [MVP]" <Software_AT_Darkfalz.com> wrote in message
news:#f**************@tk2msftngp13.phx.gbl...
well, you have two options, only one of which applies here in a Server Side group.
That would be to have the selection of the first one cause a .submit() to
happen where you can read the value and limit the second selection box
results.

--
----------------------------------------------------------
Curt Christianson (Software_AT_Darkfalz.Com)
Owner/Lead Designer, DF-Software
http://www.Darkfalz.com
---------------------------------------------------------
..Offering free scripts & code snippits for everyone...
---------------------------------------------------------

"middletree" <mi********@htomail.com> wrote in message
news:e0**************@TK2MSFTNGP10.phx.gbl...
We have all seen those web pages which feature a multiple <select> box on the left, and an empty one on the right, and the user selects one or

several
options from the left box, clicks a button, and those selections appear in the right box.

Although I have seen these, I have never tried coding them before, until
now. I imagine that there is some client-side code involved, but because

my
code will use ASP to do some stuff with the selections, I figured it was

OK
to ask it here. Can someone direct me to some sample code for this?

I have searched on some ASP code sites, but haven't found anything,

probably
because I don't know a short description for this kind of thing.


Jul 19 '05 #3
I'd suggest using JavaScript to submit the page (assuming the page is
being posted back to itself anyway) and then if the page is a post, show
the extra info in the second listbox. You can see an example of this on
the sample database on the Web on my site -
www.bullschmidt.com/login.asp and then go to the Invoices dialog and
choose a rep in the listbox and notice that the page is posted to
itself, the customers listbox then gets the focus, and the customers
listbox only contains the customers for that rep.

And here's a function I've used to submit the page for this purpose:

function RefreshPg(pstrFldName) {
// Purpose: Refresh pg. to update other fld(s) based on selection.
// Remarks: Used by combo's onchange.
// Assumes existence of document.frmMain.FocusedFldName hidden fld.

// Set focused fld for when come back.
document.frmMain.FocusedFldName.value = pstrFldName;

// Msg.
alert("Refreshing page to update other field(s) based on your
selection.");

// Submit pg to itself to refresh other combo based on this combo.
document.frmMain.submit();
}

Best regards,
J. Paul Schmidt, Freelance ASP Web Developer
http://www.Bullschmidt.com
ASP Design Tips, ASP Web Database Demo, Free ASP Bar Chart Tool...
*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!
Jul 19 '05 #4

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

7 posts views Thread by mcanedo | last post: by
2 posts views Thread by ivowel | last post: by
reply views Thread by ivan | last post: by
reply views Thread by gheharukoh7 | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.