passing button name to javascript

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • mjoshi
    New Member
    • Mar 2008
    • 1

    passing button name to javascript

    Hi

    I want to pass the name of the button to the javascript on its on click

    i have used this.name but its giving object required error

    plz help
  • acoder
    Recognized Expert MVP
    • Nov 2006
    • 16032

    #2
    Post the relevant code or at least a simple example which shows the problem.

    Comment

    • malav123
      New Member
      • Feb 2008
      • 217

      #3
      HI,
      You can use following..
      Btn.Attributes. Add("onClick", "return function(this.f orm)")
      and then you can use any field of your form in javascript function by using form.fieldname. ....



      -malav.

      Comment

      • acoder
        Recognized Expert MVP
        • Nov 2006
        • 16032

        #4
        Originally posted by malav123
        HI,
        You can use following..
        Btn.Attributes. Add("onClick", "return function(this.f orm)")
        and then you can use any field of your form in javascript function by using form.fieldname.
        That's assuming that the OP is using .NET. There's nothing in the question to suggest that.

        Comment

        Working...