Button confusion

Results 1 to 2 of 2

Thread: Button confusion

  1. #1
    Join Date
    Dec 1969

    Default Button confusion

    Can someone clear up for me whether a button (input type=&#039;button&#039;), can be used in similar ways as a text box?<BR>I am creating a dynamic list of drop-down boxes, with a button at the end. The user clicks the button and from this I want to be able to determine what line they are on. ie. what selections they have made from that dropdown box. Anyway, I am using code as:<BR>&#060;input type=&#039;button&#039; value=&#039;+&#039; onClick=&#039;add(this)&#039;&#062;<BR>For testing I am using:<BR>function add(obj)<BR>{ with (obj){ alert(value)}}<BR><BR>I get the message that &#039;object doesnt support this property or method&#039;.<BR><BR>Can anyone clear this up for me? I have searched the net and have found sites that say that the input button does have a value attribute, but they dont have any examples, so i cant see how this works.

  2. #2
    Join Date
    Dec 1969

    Default RE: Button confusion

    a button can have an event attached to it......i&#039;m not certain about a button having a value attached to it, other than what the button has on it, as in text.<BR><BR>ex.: &#060;input type=button value="CLICK TO ENTER"&#062;.......then the button has that text on it.<BR><BR>i think whatever it is you&#039;re trying to accomplish needs to be done in an OnClick event that you attach to the button. you&#039;ll need to create a javascript function that is called whenever the button is clicked.<BR><BR>ex., &#060;input type=button value="CLICK TO ENTER" onclick="submitevent()"&#062;..........then whenever the button is clicked, the function, submitevent(), is called. inside this function you can do various things.<BR><BR>sounds like you might be in over your head a little bit. join the club.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts