How to add 2 buttons that do 2 things in JavaScript?

1 Answer

Answer :

Can you share some code? Can probably get you on the right track here. To start, I’d double check whatever you’re using to target the form and make sure it’s right. Some common things might be a class or id, make sure it’s not shared between both and make sure you’re calling the right target for the right button.

Related questions

Description : How do I make an HTTP request in JavaScript?

Last Answer : There are several ways to make an HTTP request in JavaScript, and the choice of which to use depends on the type of request you need to make and whether you want to use modern standards or not. ... .data)); Which option you choose will depend on your needs and which browsers you need to support.

Description : How to make a javascript code between shortcodes showing in Wordpress?

Last Answer : answer:My guess is that Wordpress is stripping the javascript out. I found this: http://codex.wordpress.org/Using_Javascript

Description : Anyone here who is a good JavaScript coder or can recommend someone who is?

Last Answer : PMing you, @ETpro.

Description : How can client-side Javascript determine the iOS version of an iPhone?

Last Answer : This sums up the atate of the art pretty well.

Description : Is Google Docs developed by JavaScript?

Last Answer : It is developed in Javascript.

Description : My JavaScript code doesn't work in Firefox?

Last Answer : Frames…haven’t seen those in a long time.

Description : Does Javascript support conditional if/then regular expressions?

Last Answer : Javascript is an ECMA language whose regex implementation sadly doesn’t include the conditional syntax. Here’s a very thorough reference chart in case you’re curious about other implementations.

Description : Do you know a website where an option selection list shows you a popup or lightbox of each option onMouseover or onSelect?

Last Answer : Can’t you invoke a Javascript function with onmouseover and onmouseout?

Description : Why is drag-and-drop image upload not implemented more often on websites?

Last Answer : answer:When you let people upload to your server there are always security risks, but as far as I know there are no extra security problems with the system you mention. At a guess, I'd say ... but IE also has problems some times understanding even the most basic of HTML code, so no surprises there.

Description : Why Won't My Lightbox Light Up in IE?

Last Answer : What version of IE is it?

Description : How to connect to the server on the chatroom on your website?

Last Answer : answer:This is the Blogger Chat Box: http://blog.chatroll.com/how-to/add-a-free-blogger-chat-box-widget-to-your-blogspot-blog You will have less control over the specs, but it would work :D Hope this helps.

Description : Best books for learning ActionScript?

Last Answer : read the adobe manual here. Not joking. If you know how to program already, this will be the most complete explanation. Plenty of inline go samples as well.

Description : How do I get MySpace music to play on Camino?

Last Answer : I think you can’t do it.

Description : jQuery or Mootools?

Last Answer : DOMAssistant ;-) Seriously, though, it's pretty much impossible to answer your question unless you tell us more. Specifically, what is/are your use case(s)? What are you trying to do that you want ... What do you value in a library (e.g., comprehensiveness? smallest possible download? ease of use?)?

Description : Scriptaculous effect on Element.insert?

Last Answer : answer:Assuming that you only want to highlight or blind down (or any other effect that you desire) only the content you've inserted and not the whole activity' object, then I think you'll be faced ... insert({ top: ''+transport.responseText+'' }); new Effect.BlindDown( newText'); Hope that helped!

Description : How can I add "load next 10 items" buttons on my iPhone webapp?

Last Answer : I’ll be happy to help! How is your web app built? Is it PHP/Ruby/Python based? Do you use a database? If so, what software?

Description : how to add social media buttons with the use of CSS.? -How To ?

Last Answer : answer:

Description : How to add animation and effects to buttons with css? -How To ?

Last Answer : answer:

Description : When do you see buttons in elevators "G" for Ground and when is it "1"(1st) floor?

Last Answer : And G can be for garage. I think it depends on the individual building, and how they set it up. And L can be for lobby, where 1 is for the floor above.

Description : Have you ever been on a elevator where some kid has pushed all the buttons?

Last Answer : I had to stay on. It was my kid who did it.

Description : If my microwave oven is really listening to me, why do I have to push the buttons to turn it on?

Last Answer : answer:Do you think Kellyanne Conway’s microwave listens to her? No, but she does talk to it.

Description : Whatever happened to pin-back buttons [You might need link provided in Details.]?

Last Answer : answer:I have a few vintage political ones. And actually my daughter gave my husband a whole handful (ouch) of small pins for Bell’s Brewery recently. I should take a photo but I’m in bed in the dark posting this. Long time no see!

Description : Why is my Firefox not displaying the upper right function buttons of 'minimize', 'maximize' and 'close'?

Last Answer : answer:Perhaps you accidentally pressed the F11 key. Press it once to see if you get those buttons back.

Description : What can koumpounophobics (fear of buttons) wear to a professional job interview?

Last Answer : answer:If you can find a friend to help you with the sewing task, you can replace the buttons on a dress shirt with hidden bits of velcro. As long as you wear a tie with a tie-pin to ... . (Interviewers look mainly at your face, hands and shoes). ETA: cuff buttons can be replaced with cufflinks.

Description : In what ways radio buttons and check boxes can be selected in web forms by using a keyboard?

Last Answer : answer:Tab + up, down, left and right keys (depending on the set-up: left to right or top to bottom). Edit: for check boxes, sometimes you might need to use the space bar to make a selection.

Description : How many buttons should I have on my arcade machine?

Last Answer : Now that’s a fun challenge! Can you make it re-configurable? Or maybe a standard config with just a few buttons that cover most situations, plus some ports that let you plug in some extreme controllers?

Description : Do all the various buttons on the blender really do anything?

Last Answer : What drink are you attempting to make right now? Perhaps that would assist us in formulating an effective answer.

Description : Why are belly buttons located there?

Last Answer : It’s at the center of the body, mass-wise, and would make the transportation of nutrients throughout the fetus close and easy.

Description : Are the track skipping buttons in ios 4.3.2 closer together?

Last Answer : I think it’s just you.

Description : Does anyone know of an app on the Android market that disables buttons during a phone call?

Last Answer : Ask this in general section to get faster answers ^^

Description : My PSP's home/volume buttons don't work?

Last Answer : Time to get a new one sounds like:(

Description : My Google Chrome is becoming bloated with the buttons for so many plugins, now what?

Last Answer : I would say you should take some off. I remember when I first got Firefox and everyone thought it was the greatest thing ever, but it started bugging out when I started adding on a bit much. Chrome ... noticed any yet?), I stopped using Chrome because of it's login problems (especially with G-mail).

Description : Belly buttons which do you prefer, in or out, and which do you have right now?

Last Answer : answer:I totally forgot outies existed until a couple months ago. Man was that a shock. I wonder what percentage of outies invert over time…

Description : How can I specify the page name for Twitter and Facebook sharing buttons on front page of website?

Last Answer : answer:I know what you're talking about and have had a bit of experience designing a system like the Facebook and Twitter ones for a site I co-developed. Here's an example of how you do it on our ... because that seems to be related to the Like button in some way. Sorry I can't be more helpful

Description : Do you like buttons?

Last Answer : My grandmother had big jars of buttons, yes, they were fun to pour out and sort through. Her old dolls were creepy though. lol

Description : Does the buttons background color at Fluther.com made with CSS only or it is an image?

Last Answer : answer:It's an image. Fluther uses sprites to compress the amount of image downloading the user does with each page request. If you look at the sprite image the buttons are there. Note that ... If you look at Google using Safari or Chrome, the visual effect is accomplished entirely without images.

Description : The Up volume key on my Macbook is showing the dashboard, and some other buttons are acting weird, help!

Last Answer : What happens if you create a new user account? Do the problems persist on the new user account?

Description : Why do ears and belly buttons smell similar? And why do they smell gross?

Last Answer : Who smells these things?

Description : Toshiba Satellite media control buttons question!

Last Answer : Sounds like a driver issue to me. I would take a look on the Toshiba website to make sure you’re all up to date, or even take a peek through the discs that came with the computer (if you still have them).

Description : Why would taskbar buttons be randomly flashing without user input?

Last Answer : Specifically what taskbar buttons are these? They may be running something, so when it is finished they flash.

Description : Why won't the volume buttons on my Windows XP work anymore?

Last Answer : Without examining your system, it sounds as if some other program has insinuated itself as the default for handling these issues. I would suggest reinstalling the EEE’s native program for media management, and making sure that it checks to make sure it is the default for associated files upon boot.

Description : Is Fluther blocking your use of question/answer buttons a form of punishment for bad behavior?

Last Answer : details?

Description : Do you ever use the extra buttons that come with your clothing?

Last Answer : Never!!!

Description : For those of you who have non-flip cell phones, how do you avoid accidently pressing buttons?

Last Answer : Lock your keypad. Here’s a user guide for your phone.

Description : It's 11:00. Do you know where your spare buttons are?

Last Answer : I keep all of mine in a bag in my bathroom. I doubt I’ll ever use them, but just in case, they are always there. I also keep spare thread and beads that are sometimes attached to clothes. Maybe someday I’ll make a collage out of them. Probably not.

Description : where can I find big artsy wooden buttons?

Last Answer : Do you have any arts and crafts stores near you? That might be a good place to start looking.

Description : Why do comcast remotes have picture in picture buttons?

Last Answer : answer:I’m in Chicago and the Comcast remotes here have that function too. I think the reason for having it is for future use if they ever decide to enable the feature. -R

Description : Why do some bathroom appliances (hair drier, electric ravors, ect) have those buttons on the plug?

Last Answer : Appliance Leakage Circuit Interrupter to prevent accidental electrocution. It renders the device inoperable in certain abnormal circumstances, like say, immersion in water.

Description : How do i remove unnecessary buttons from a google map snippet on my blog?

Last Answer : I made a example of this for you. View the source to see how it was done. You will need to change the API key to the one for your site.

Description : Most of the laptops have the touchpad and 2 buttons that are supossed to be like the mouse, but, in a macbook, with only one button, what should i do when im playing a game where i need to hit the right button?

Last Answer : Hit the control key while clicking the track pad. It acts as a right click.