473,386 Members | 1,798 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,386 software developers and data experts.

how to know which of the 2 buttons are clicked

hi there,

how will i know which of the 2 buttons are clicked. i tried using
var flag = document.frmMain.btnSave.Clicked;
and printing the value of flag to know. but it turns out to be null.

can anyone help me out here please..
Feb 1 '08 #1
6 1389
rpnew
188 100+
hi there,

how will i know which of the 2 buttons are clicked. i tried using
var flag = document.frmMain.btnSave.Clicked;
and printing the value of flag to know. but it turns out to be null.

can anyone help me out here please..
Hi,
well what do you exactly want to do? i mean as what i understood you have two buttons and you want to kwow which of them is clicked..rigtht? well you can do the following then... call one function by passing some value... and through value you'll know which button is clicked......... or post your code here so we can have a look at it...... and give you some ideas.......

Regards,
RP
Feb 1 '08 #2
hey thanks for the response so soon.
actually there are 2 buttons save and save n close.
right now both of them behaves the same way as how save is clicked.
so i want to know which button is clicked so that i can make it act like that.
hope this gives u an idea
Feb 1 '08 #3
rpnew
188 100+
hey thanks for the response so soon.
actually there are 2 buttons save and save n close.
right now both of them behaves the same way as how save is clicked.
so i want to know which button is clicked so that i can make it act like that.
hope this gives u an idea
hi,
well if you want to do different things on clicking different buttons then simply define two different function and call them on onclick event of these buttons...........
However what are you using as your frontend?... post your code where you are creating these buttons.........

Regards,
RP
Feb 1 '08 #4
front end is the XSL that we are using. what should the functions take in as argument. can u write an e.g function
Feb 1 '08 #5
rpnew
188 100+
front end is the XSL that we are using. what should the functions take in as argument. can u write an e.g function
Hi,
i meant something like this.......

[HTML]
<input type=button value="save" onclick="javascript: functionone()">
<input type=button value="save n cancel" onclick="javascript: functiontwo()">
[/HTML]

Expand|Select|Wrap|Line Numbers
  1. function functionone()
  2. {
  3.    //code goes here
  4. }
  5. function functiontwo()
  6. {
  7.    //code goes here
  8. }
  9.  
Feb 1 '08 #6
gits
5,390 Expert Mod 4TB
just to mention that you should correct the html, put the attribute values in quotes and the javascript: is really obsolete too ... the function call is always enough:

[HTML]<input type="button" value="save" onclick="functionone();">[/HTML]
kind regards
Feb 1 '08 #7

Sign in to post your reply or Sign up for a free account.

Similar topics

4
by: Bosconian | last post by:
This is more of an HTML question, but it's related to a PHP project. I have a simple form consisting of 2 selects, 1 text input and a submit button. The form action submits to the same page. ...
9
by: Krunom Ancini | last post by:
Hi, I have on my page something about 50 buttons that "user" should use only for loading some session-variables: click on the button -> session variables loaded and i wish that after...
6
by: Terry | last post by:
Good morning! How do I determine which SELECT button was clicked in a GridView? The multiple SELECT buttons will be used for an application approval process. Thank you in advance for your...
5
by: mayur_hirpara | last post by:
Hi, I have been developing web applications for a while now. However, as I was thinking through the architecture I really don't understand the "How server can identify between which buttons has...
2
by: Gummy | last post by:
Hello, I have a user control that has radio buttons and a listbox. This user control is repeated several time on my webpage. What I want to do is alert the main page that the radio buttons...
1
by: JHawk24821 | last post by:
I am building a simple card matching game where the user picks two buttons on a form out of a group of buttons in an attempt to find a match. I have already taken care of the randomization needed...
2
by: tmarch001 | last post by:
HI, I am currently working on a site that has a horizontal scrolling menu, that is made up of a series of movie clips, the last of which contains my buttons. The trouble I am having is that the...
5
by: Charles May | last post by:
I have a form that creates a button for each employee in the database. I have added the click handler and have this working. The buttons contain the employee's name for their respective .Text and I...
1
by: tiijnar | last post by:
Hi, I am using a JSP in my application. In JSP page I created tables and buttons inside a loop. <% i=0; while(i<4) { %> <table align="left" width="100%"> <tr>
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.