Re: [OT] Quick Java Help

This WebDNA talk-list message is from

2004


It keeps the original formatting.
numero = 55916
interpreted = N
texte = Here is some JS code that is triggered by a change in one menu ("service"). It re-creates the second menu ("Chemistry") and then sets the selected item accordingly. The menu recreation step is necessary according to an old copy of Danny Goodman's JavaScript Bible. -=-=-=-=-=-=-=-=- begin JS -===-=-=-=-=- function chemServ(form) { docC = form.chemistry docCv = form.chemistry.options[docC.selectedIndex].value docS = form.service docSv = form.service.options[docS.selectedIndex].value if (docSv == "Rxn and Analysis") { form.chemistry.options.length = 0 form.chemistry.options[0] = new Option("BDSF's Choice","BDSF's Choice") form.chemistry.options[0].selected = true } else { form.chemistry.options.length = 0 form.chemistry.options[0] = new Option("","") form.chemistry.options[1] = new Option("BigDye TERM v3.1","BigDye TERM v3.1") form.chemistry.options[2] = new Option("BigDye TERM v3.0","BigDye TERM v3.0") form.chemistry.options[3] = new Option("BigDye TERM v2.0","BigDye TERM v2.0") form.chemistry.options[4] = new Option("BigDye TERM v1.1","BigDye TERM v1.1") form.chemistry.options[5] = new Option("BigDye TERM v1.0","BigDye TERM v1.0") form.chemistry.options[0].selected = true } window.status = 'filled' return true } -==-=-=-=-=-=-=-=- end JS -==-=-=-=-=-=-=-=-=-= trigger: =--=-=-=-=-=-=-=-=-- begin HTML -=-==-=-=-=-=-=-=-   Request Type:      Chemistry:      -==-==-=-==-=--=-- end HTML -==-=-=-=-=-=-=--=-= Dave Hurley Department of Biology University of Washington On Feb 3, 2004, at 8:07 AM, Steve Craig wrote: > Hi > > Sorry for the OT it's just I need to solve this today. > > I need a piece of JavaScript or something that will populate a drop > down > menu depending on what another one is set too. > > I have a dna page that will return a list of clients to one menu and > depending on that, choose a list of projects from the other but I want > it > all on 1 page with no refresh. So if someone picks a new client they > instantly see only that clients projects. Hope that makes sense. > > Pretty standard stuff I know I'm just in a hurry, anyone know of > anything > that I can nick/borrow? > > Cheers > ======================================== > Steve Craig - Asylum Interactive Ltd > Tel +44 1224 642960 Fax +44 1224 642962 > ======================================== > http://www.asylumweb.com > Email: steve@asylumweb.com > ======================================== > > > > > ------------------------------------------------------------- > This message is sent to you because you are subscribed to > the mailing list . > To unsubscribe, E-mail to: > To switch to the DIGEST mode, E-mail to > > Web Archive of this list is at: http://webdna.smithmicro.com/ > ------------------------------------------------------------- This message is sent to you because you are subscribed to the mailing list . To unsubscribe, E-mail to: To switch to the DIGEST mode, E-mail to Web Archive of this list is at: http://webdna.smithmicro.com/ Associated Messages, from the most recent to the oldest:

    
  1. Re: [OT] Quick Java Help ( Dave Hurley 2004)
  2. [OT] Quick Java Help ( Steve Craig 2004)
Here is some JS code that is triggered by a change in one menu ("service"). It re-creates the second menu ("Chemistry") and then sets the selected item accordingly. The menu recreation step is necessary according to an old copy of Danny Goodman's JavaScript Bible. -=-=-=-=-=-=-=-=- begin JS -===-=-=-=-=- function chemServ(form) { docC = form.chemistry docCv = form.chemistry.options[docC.selectedIndex].value docS = form.service docSv = form.service.options[docS.selectedIndex].value if (docSv == "Rxn and Analysis") { form.chemistry.options.length = 0 form.chemistry.options[0] = new Option("BDSF's Choice","BDSF's Choice") form.chemistry.options[0].selected = true } else { form.chemistry.options.length = 0 form.chemistry.options[0] = new Option("","") form.chemistry.options[1] = new Option("BigDye TERM v3.1","BigDye TERM v3.1") form.chemistry.options[2] = new Option("BigDye TERM v3.0","BigDye TERM v3.0") form.chemistry.options[3] = new Option("BigDye TERM v2.0","BigDye TERM v2.0") form.chemistry.options[4] = new Option("BigDye TERM v1.1","BigDye TERM v1.1") form.chemistry.options[5] = new Option("BigDye TERM v1.0","BigDye TERM v1.0") form.chemistry.options[0].selected = true } window.status = 'filled' return true } -==-=-=-=-=-=-=-=- end JS -==-=-=-=-=-=-=-=-=-= trigger: =--=-=-=-=-=-=-=-=-- begin HTML -=-==-=-=-=-=-=-=-   Request Type:      Chemistry:      -==-==-=-==-=--=-- end HTML -==-=-=-=-=-=-=--=-= Dave Hurley Department of Biology University of Washington On Feb 3, 2004, at 8:07 AM, Steve Craig wrote: > Hi > > Sorry for the OT it's just I need to solve this today. > > I need a piece of JavaScript or something that will populate a drop > down > menu depending on what another one is set too. > > I have a dna page that will return a list of clients to one menu and > depending on that, choose a list of projects from the other but I want > it > all on 1 page with no refresh. So if someone picks a new client they > instantly see only that clients projects. Hope that makes sense. > > Pretty standard stuff I know I'm just in a hurry, anyone know of > anything > that I can nick/borrow? > > Cheers > ======================================== > Steve Craig - Asylum Interactive Ltd > Tel +44 1224 642960 Fax +44 1224 642962 > ======================================== > http://www.asylumweb.com > Email: steve@asylumweb.com > ======================================== > > > > > ------------------------------------------------------------- > This message is sent to you because you are subscribed to > the mailing list . > To unsubscribe, E-mail to: > To switch to the DIGEST mode, E-mail to > > Web Archive of this list is at: http://webdna.smithmicro.com/ > ------------------------------------------------------------- This message is sent to you because you are subscribed to the mailing list . To unsubscribe, E-mail to: To switch to the DIGEST mode, E-mail to Web Archive of this list is at: http://webdna.smithmicro.com/ Dave Hurley

DOWNLOAD WEBDNA NOW!

Top Articles:

Talk List

The WebDNA community talk-list is the best place to get some help: several hundred extremely proficient programmers with an excellent knowledge of WebDNA and an excellent spirit will deliver all the tips and tricks you can imagine...

Related Readings:

Looking for 5 to 12 shops with 3 URLs & statements (1997) Re[2]: New syntax feedback for 4.0 (2000) Site Builder & IE Mac (2004) Problem displaying search result (1997) need some help with a loop (1999) Separate SSL Server (1997) Re[2]: Base64 encryption limitations? (1999) Traffic - FYI (2003) Re:E-Mailer (WebCatb15acgiMac) (1997) [WebDNA] Installation problems for IIS 6 (2010) talk list (2000) Extended [ConvertChars] (1997) problems with 2 tags (1997) WebDNA Solutions ... sorry! (1997) Confusing [protect] (long) (1999) Windows 95/NT tip of the month (1998) WebCat2b13 Mac plugin - [sendmail] and checkboxes (1997) sendmail logs (1999) subscribe (2002) several .hdr files with one db file? (1999)