473,322 Members | 1,690 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,322 software developers and data experts.

Name of the button


Hi,

<body onUnload="unloadhandler();">

<input type="button" name="Save" onClick="onclickhandler();"/><br>

function onclickhandler()
{
document.location.href="http://www.google.com";
}
so, on clicking button , unloadhandler is called.

function unloadhandler()
{
i want the name of the button clicked(Save) here.

is it possible?
}

Jul 23 '05 #1
2 1492
Nithya Venkatachalam wrote:
Hi,

<body onUnload="unloadhandler();">

<input type="button" name="Save" onClick="onclickhandler();"/><br>

function onclickhandler()
{
document.location.href="http://www.google.com";
}
so, on clicking button , unloadhandler is called.

function unloadhandler()
{
i want the name of the button clicked(Save) here.

is it possible?
}


<body>
<input type="button" name="Save" onclick="onclickhandler(this.name)" />

function onclickhandler(buttonName){
//onunload code here.
document.location.href="http://www.google.com";
}

--
Randy
comp.lang.javascript FAQ - http://jibbering.com/faq
Jul 23 '05 #2
Pass the name of the button as a parameter

"Nithya Venkatachalam" <vn*****@gmail.com> wrote in message
news:ch********@odah37.prod.google.com...

Hi,

<body onUnload="unloadhandler();">

<input type="button" name="Save" onClick="onclickhandler();"/><br>

function onclickhandler()
{
document.location.href="http://www.google.com";
}
so, on clicking button , unloadhandler is called.

function unloadhandler()
{
i want the name of the button clicked(Save) here.

is it possible?
}

---
Outgoing mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.744 / Virus Database: 496 - Release Date: 8/24/2004
Jul 23 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
by: Jon W | last post by:
I have a db table like list in a form. All the buttons have the same name. How do I know what index the button has in the button array onclick. <button name="shed" value="Edit2"...
7
by: Stefan Mueller | last post by:
How can I set the Name of a button? I tried xelement = document.createElement("input") xelement.type = "button" xelement.name = "MyButton" but it does not work with the Internet Explorer...
3
by: simon | last post by:
I have button in asp:repeater control. <asp:Button Runat=server ID=btnPList Text="..." CommandArgument='<%# DataBinder.Eval(Container.DataItem,"datumP")%>'></asp:Button> In code behind I use...
5
by: engsolnorm | last post by:
I'm playing with a sudoku GUI...just to learn more about python. I've made 81 'cells'...actually small canvases Part of my scheme to write the cells (all 81 of them in the gui) to a file (using...
6
by: btknorr | last post by:
The following html and javascript combination fails to execute in Internet Explorer...does anyone know why? If you change the input's attribute "name" to anything other than "item" it works just...
2
by: Yoshitha | last post by:
Hi I've created some buttons at runtime and all these are having unique names and also created event handler for the buttons created at run time like this { btn.Size =new...
7
by: Chuck Anderson | last post by:
I'm pretty much a JavaScript novice. I'm good at learning by example and changing those examples to suit my needs. That said .... ..... I have some select fields in a form I created for a...
10
by: Rob | last post by:
I am reading a book that says that the "name" property can be altered only at design time and cannot be modified at runtime. Please explain this given the code below... If you click Button3......
7
by: moksha | last post by:
Hi, I am new to javascript and i am facing a problem in coding. plz help me out. I am using javascript for dynamically creating a table row which contains text boxes and radio...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...

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.