Passing select boxes as parameter so only using one function

Hello to all. I"m having trouble with my Javascript. I tried posting this question to some "Javascript" forums and nobody has replied until now I guess they don't know the answer, so I'm hoping that you guys here can answer this kind of question.
Here was my post
"Hello. Is there any way that I can pass an actual <select> box as a parameter so I can use only one function in my javascript. Hmm.. here's kind of the situation
I have two select boxes
selectbox1 and selectbox2
and for each select box I have a javascript function
myfunction1 and myfunction2
these functions do exactly the same thing
how can I do it in such a way that it accepts the select box as a parameter and how do I use that parameter when inside the function?"

You can use the keyword "this" to pass a reference to the <select> box as a parameter to the function.
In the case of events "this" refers to the object the event is being invoked on - button, selectbox, textfield...
<script language="javascript">
  function changeCombo(theSelectBox){
    alert('you changed ' + theSelectBox.name);
    alert("value = " + theSelectBox.value);
</script>
<hr>
Letter: <select name="s1" onchange="changeCombo(this)">
  <option value="a">a
  <option value="b">b
  <option value="c">c
</select>
Number: <select name="s2" onchange="changeCombo(this)">
  <option value="1">1
  <option value="2">2
  <option value="3">3
</select>

Similar Messages

  • HT201342 How can I add an e-mail address to my existing icloud addresses?  I currently only use one and I would like to ad two more?

    How can I add an e-mail address to my existing icloud account?  I curently only use one of the three.

    Each iCloud account only has a single iCloud account.  If you want, you can add up to 3 alias addresses that will receive email in the same iCloud inbox, as explained here: http://support.apple.com/kb/PH2622.

  • I have two users with different music on each itunes and i can only use one library, how do i use both for one iTouch?

    i have two users with different music on each itunes and i can only use one library, how do i use both for one iTouch?

    Chris, I believe this link may have the information you're looking for. Welcome to discussions!
    http://docs.info.apple.com/article.html?artnum=300432

  • How do I remove an authorized computer from my itunes account? I am only using one.

    How do I remove an authorized computer from my itunes account? I am only using one.

    http://support.apple.com/kb/PH12303
    Barry

  • Can I install CC on three computers - I only use one of them at a time?

    I'd like to use CC on three computers in three cities where I travel - I only use one computer at a time - is this possible with a single license? If so, how?

    As long as you sign out of at least one of them you can.  Sign out before you depart from a given city and you should be set to sign in at another.

  • Since installing an icon-editing add-on, I can't open tabs any more / I can only use one tab at a time.

    Ever since I installed the add-on Favicon Picker 2 that lets you change the bookmark icons, I can't open tabs any more. The second tab will open, but if you try to go to a site, the FIRST tab redirects to that site. Basically, I can only use one tab at a time. Is there any way I can keep this add-on and use tabs?

    Oh, wow - look at that, you're right :) I didn't want to uninstall the add-on as I like the feature, but simply by disabling it you can keep the new icons AND use tabs. Thanks dude!
    (The add-on is Favicon Picker 2 0.6.2.15 by the way - some of the user reviews report the same problem.)

  • 2 atv's both have home sharing enabled but one asks to turn on home sharing on my pc but it is on so can only use one at a time to watch movies from my computer

    2 atv's both have home sharing enabled but one asks to turn on home sharing on my pc, but it is enabled on pc so I  can only use one at a time to watch movies from my computer

    Both atv,s are on the same network, they are wirless and the computer can see them and they are named different.
    what ever one i switch on first gets to stream from my computer and the other one asks for home sharing to be switched on, then if i switch both off and start the other one first it gets to stream and the other one which worked asks for home sharing to be turned on. i have hidden all functionality, netflix etc as these are for my 7yr old kids.

  • AME is only using one processing core out of six.

    I have not been able to figure out why AME is only using one of the six processing cores that I have in my Core i7 hex core processor.  I'm running Windows 7 Ultimate 64 bit and the latest version of AME 2014 CC.  When I render in Premiere Pro CC 2014 all cores are utilized.  The codec that I'm using in AME is "YouTube SD 480P 29.97 - H.264".  The video that is being encoded is fairly complex but it is only 30 minutes long and AME is estimating 18 hours to completion.  That seems pretty excessive for that length of video.
    Any help would be greatly appreciated.

    This forum post may be related to your question. 
    Re: AME CC2014 Very Slow Encoding

  • I have  my photoshop cc installed on my Mac and my windows laptop is it true that I can only use one or the other now? and if this is the case if my mac were turned off should my laptop now work? I am on the photoshop photography program

    i have  my photoshop cc installed on my Mac and my windows laptop is it true that I can only use one or the other now? and if this is the case if my mac were turned off should my laptop now work? I am on the photoshop photography program its just that i have never noticed tho before i have my mac turned on and the laptop PS works fine on the Mac but not on the Laptop

    Hello,
    see >>> http://helpx.adobe.com/creative-cloud/help/install-apps.html  here >>> How many computers can I install on
    I quote: You may install software on up to two computers. These two computers can be Windows, Mac OS, or one each.
    If you install on a third computer, it will request you to de-activate on the other two computers. You can then reactivate one of the previous two computers, and use Creative Cloud apps on it.
    Good luck!
    Hans-Günter

  • Why only using one CPU

    Just noticed when importing CD into iTunes on my MacBook is only uses one cpu, with activity monitor it show 98-100% CPU and never goes over 100%
    My fans also run when importing, I use lossless.
    Why not use more CPU speed?
    R

    I believe only applications writen to do so will take advantage of dual processors. I guess iTunes has not yet been updated for dual processor use.
    Patrick

  • Dual G5 only using one processor in Logic 8

    So...
    Why does my Dual G5 only use one of the two processors in Logic 8? The one processor will go to max, stop the song from a cpu overload, yet the second processor never kicks in.
    Please help! U_U
    Thanks,
    bp

    it seems that the buffer settings on audio preferences are too small.
    use this setting:
    I/O Buffer Size: 512
    Process Buffer Range: Large
    Or... you are using some heavy third party Virtual Instrument that don't support Altivec on PPC processors.
    (many software houses make good plugins that works fine on Intel processors but they forget to use Altivec implementation for PPC Mac side)
    G

  • Multisim 11 only uses one CPU core during simulation

    Hi,
    Just recently I've been using MultiSim again, v11 if that matters, and simulating goes slow, to my opinion that is.
    Now there are two things that I've noticed:
    - Multisim only uses one of two CPU cores during simulation, not both;
    - I've enabled CPU throttle (AMD's Cool'n'Quiet) but corespeed remains very low even though Multisim needs CPU power while simulating.
    The simulating of a NE555-based LED-flash circuit requires about 28 seconds to get to 100ms in the simulation. Now if I can get the CPU to throttle up, by for example having Prime95 stress one of the two cores, then the simulation only requires 12 seconds to get to 100ms.
    So here are my two questions:
    1. Is Multisim 11 capable of using more than one CPU core while simulating? If yes, how can I get it to use more than one?
    2. Probably not the right forum to ask, but is there a way to force Windows 7 Ultimate x64 to throttle up the CPU when Multisim starts simulating? Since Multisim does not seem to stress the only core it uses enough to throttle it up. Using Prime95 on one core does trigger a throttle up.
    With regards,
    Bart Grefte
    Relevant specs:
    Windows 7 Ultimate x64
    Multisim v11
    AMD A4-3400
    16GB RAM

    Completely forgot this topic....
    Is there a good reason why there is no multicore support? Multisim can certainly use it for simulating.
    As for the CPU throttling, I found a batch that can increase/decrease the "minimum processor state"-setting and it works immediately, no reboot required.
    @echo off
    powercfg.exe -getactivescheme > "%userprofile%\appdata\~apo.tmp"
    set /p v_currentscheme= <"%userprofile%\appdata\~apo.tmp"
    set v_currentscheme=%v_currentscheme:~24,36%
    del "%userprofile%\appdata\~apo.tmp"
    powercfg -setacvalueindex %v_currentscheme% 54533251-82be-4824-96c1-47b60b740d00 893dee8e-2bef-41e0-89c6-b55d0929964c %1
    powercfg -setdcvalueindex %v_currentscheme% 54533251-82be-4824-96c1-47b60b740d00 893dee8e-2bef-41e0-89c6-b55d0929964c %1
    powercfg -s %v_currentscheme%
    exit
    Usage is simple:
    Start -> run -> c:\pathtobatch.bat 100
    for "minimum processor state"-setting at 100%
    Start -> run -> c:\pathtobatch.bat 5
    for "minimum processor state"-setting at 5%
    Please note that "set v_currentscheme=%v_currentscheme:~24,36%" is not the same for every language. The original batch had "set v_currentscheme=%v_currentscheme:~19,36%" (most likely for the English version of Windows 7), but since my Windows install is in Dutch, I had to change it in order for it to work.
    Running the batch with @echo off removed will show why.

  • Pages '09 only uses one processor core?

    Hello,
    some days ago i had to open a document containing nearly 2.000 pages. Don't ask why.
    Working with this document was quite complicated because Pages was responding very slowly. I used the activity monitor to see what was going on and i recognized that Pages only uses one core of my eight core MacPro.
    I tested iWork on my iMac and MacBook Pro (both DualCores) as well: same problem.
    Does iWork only use one processor core?
    Kind regards,
    roman

    How much memory do you have in your system? I'll bet if you check activity monitor (applications/utilities) and go to system memory tab therein you will see lots of page outs. This happens with huge docs and little memory as the doc is being swapped between active operating memory and the hard disk The only way to solve this problem is to get more memory (not storage) in your system. For a 2,000 page doc you're going to need lots and lots and lots of extra gigs of memory. By the way - how big is the too big file of yours?
    Number of processor cores isn't going to solve the issue if you have pageouts. It is a system memory/size of document issue and completely unrelated to how many processor cores you are using.

  • Passing Select-options as parameter to function module

    I need to pass a select-option as a parameter to a function module. Is this possible?
    There is an option of passing all the values of the select-option to an internal table, passing that internal table as parameter to the function module, and then adding it manually again to a select-option in the function module.
    But is there any direct way to do this?

    Hi,
    I have a similar problem: I have RFC function module to which I want to pass select options. Therefore I defined table parameters as follows:
    IT_RUNID     TYPE     EFG_TAB_RANGES
    IT_PERNR      TYPE     EFG_TAB_RANGES
    IT_REINR     TYPE     EFG_TAB_RANGES
    I can successfully pass my values to the module, but if I try to check these parameters
    using
    CHECK IT_TRIPS-RUNID IN IT_RUNID.
        CHECK IT_TRIPS-PERNR IN IT_PERNR.
        CHECK IT_TRIPS-REINR IN IT_REINR.
    the check always fails, I guess because there are leading zeros in the ranges. Is there a way to solve this problem?
    Thanks and regards,
    Martin

  • Live Migration only using one live migration adapter

    Hi,
    I have a 2 node cluster spanning two buildings, 4 switches (2 in each building), 2 live migration NICs in each server. I have NIC1 going through switch 1 and NIC2 going through switch 2, same in the other building.
    everything talks fine to each other. I decided to team the Live Migration networks so I can get more transferring at once (getting 2Gbps instead of 1, this seemed like a good idea at the time but when I ran a test scenario of failing one of the switches
    the live migration was unable to complete (despite the switches being stacked together, maybe I have a config issue I dont know).
    so I destroyed the team and thought I'd have two seperate live mig channels, i select these two live mig channels in as live migration networks in failover cluster manager. when i try to live migrate a bunch of VM's it is only using the one adapter, no matter
    how many VM's are going down there it will deal with 2 at a time (as per hyper-v settings). 
    the question is, why is not using my other live migration channel even though that adapter is configured correctly, I have even moved it up in the list and then it will use it so i know it works, but it won't use both together...?
    thanks
    Steve

    Live Migration uses the first network interface in the order you configured it. As far as I know the second interface is only used when the first interface becomes unavailable. But don't pin me on this. Now back to your NIC teaming, because there
    is one thing you should know:
    When you configure a NIC team without a switch assisted (LACP) configuration your team will have a 2x1Gb outbound and 1x1Gb inbound connection. This is probably why you only get 1x1Gb througput.
    When you configure a NIC team with a switch assisted (LACP) configuration you team will have a 2x1Gb outbound and 2x1Gb inbound connection. Such a NIC teaming configuration is in fact a port-channel / ether-channel like you would configure between switches.
    This is an optimal configuration.
    I hope this information makes more sense to you. If you have any questions let me know.
    Boudewijn Plomp, BPMi Infrastructure & Security
    Please remember, if you see a post that helped you please click "Vote as Helpful" and if it answered your question, please click "Mark as Answer".

Maybe you are looking for

  • Table for Valuated Project stock

    Dear All, Can any one  suggest form which table I can get value of valuated project stock for whole project. I can get it through table QBEW (Project Stock Valuation), but it gives value for individual WBS only. Regards, Nitish

  • PC Speaker

    Hello there.A few days ago, after some updates a FAIL message appears during boot that says: No state is present for card pcsp Unknown hardware "PC-Speaker" "" "" "" Hardware is initialized using a guess method No state is present for card pcsp     

  • Arrow problem in CS5

    My black arrow used to allow me to scale and rotate an object after selecting.  I must have hit something, because it no longer works.  I tried drawing a square and the black arrow will now only move the object around the workspace.  Can someone plea

  • Question about display PDF content

    Hi, I'd like to show the content of a PDF file directly in a page region, without having to open the Acrobat reader in the same window and hide all the tabs, other regions... I am not sure whether this is feasible with HTMLDB, so would like to know t

  • Forte IIOP / Corba / Java other questions...

    I've a problem with Forte (3.0.E.0) generating IDL that is causing Visigenic Visibroker 2.5 (for Java) compile errors... It has something to do with the order(ing) of interfaces declaration and referencing these interfaces within the generated IDL fi