Results 1 to 3 of 3

Thread: Button Tag Doesn't Work as Advertised

  1. #1

    Thread Starter
    Member
    Join Date
    Aug 2000
    Posts
    45

    Button Tag Doesn't Work as Advertised

    I'm reading a book on Dynamic HTML and I'm a bit frustrated with the Button Tag. I've created four buttons along the bottom of my form to be used as navigation and they don't wanna play nice.

    Using the input tag I can do this:
    <input type=submit name=navbutton value=first>
    <input type=submit name=navbutton value=previous>
    <input type=submit name=navbutton value=next>
    <input type=submit name=navbutton value=last>

    Which creates an "array" of buttons. I check for the navbutton value on the server side and it tells me what button was pushed.

    When I try the same thing with the button tag I cannot create the "array" this way and the value isn't submitted as my text says it will be:

    <button type=submit name=navbutton value=next>NEXT</button>

    Instead of getting the value of the button I get the text inserted between the tags. This is NOT the name/value pair that should be submitted. For instance, in the above example I get "NEXT" as the value instead of "next".
    -Gregg
    -NoOBie At LaRg3

  2. #2
    PowerPoster abhijit's Avatar
    Join Date
    Jun 1999
    Location
    Chit Chat Forum.
    Posts
    3,228

    Post

    Try using the button.innerText property instead.
    The value would give you the value, wouldn't it?
    What did you expect?

    -abhijit
    Everything that has a computer in will fail. Everything in your life, from a watch to a car to, you know, a radio, to an iPhone, it will fail if it has a computer in it. They should kill the people who made those things.- 'Woz'
    save a blobFileStreamDataTable To Text Filemy blog

  3. #3
    Frenzied Member monte96's Avatar
    Join Date
    Sep 2000
    Location
    Somewhere in AZ
    Posts
    1,379
    That is the correct behavior of the Button tag. (didn't you wonder why there were two tags that did essentially the same job)
    oOOo--oOOo
    __/\/\onte96
    oOOo--oOOo
    Senior Programmer/Analyst
    MCP
    [email protected]
    [email protected]


    Your results may vary.. some restrictions may apply.. pricing and participation may vary.. not available in all states.. professional driver closed course..quantities limited..

Posting Permissions

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



Click Here to Expand Forum to Full Width