Name of the button

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Nithya  Venkatachalam

    Name of the button


    Hi,

    <body onUnload="unloa dhandler();">

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

    function onclickhandler( )
    {
    document.locati on.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?
    }

  • Randy Webb

    #2
    Re: Name of the button

    Nithya Venkatachalam wrote:[color=blue]
    > Hi,
    >
    > <body onUnload="unloa dhandler();">
    >
    > <input type="button" name="Save" onClick="onclic khandler();"/><br>
    >
    > function onclickhandler( )
    > {
    > document.locati on.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?
    > }
    >[/color]

    <body>
    <input type="button" name="Save" onclick="onclic khandler(this.n ame)" />

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

    --
    Randy
    comp.lang.javas cript FAQ - http://jibbering.com/faq

    Comment

    • Hal Rosser

      #3
      Re: Name of the button

      Pass the name of the button as a parameter

      "Nithya Venkatachalam" <vnithya@gmail. com> wrote in message
      news:ch14em$nlk @odah37.prod.go ogle.com...[color=blue]
      >
      > Hi,
      >
      > <body onUnload="unloa dhandler();">
      >
      > <input type="button" name="Save" onClick="onclic khandler();"/><br>
      >
      > function onclickhandler( )
      > {
      > document.locati on.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?
      > }
      >[/color]


      ---
      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


      Comment

      Working...