getting the button's value

Discussion in 'C#' started by rag84dec, Feb 6, 2008.

  1. #1
    hi,
    I have the following code to get the button's value..It is giving empty string....
    Can anyone help in getting the value of type button

    
    <form name='rag' action='tt.asp' method='post'>
    <input type=text name='ra'/>
    <input  type='button' value='Saks' name='Slskdfh' />
    <input type='submit' value='OK' name='submit'/>
    </form>
    
    
    Code (markup):
    tt.asp contains
    
    <html>
    
    <%
    response.write request.form("Slskdfh")
    
    response.write request.form("ra")
    %></html>
    
    Code (markup):

     
    rag84dec, Feb 6, 2008 IP
  2. rag84dec

    rag84dec Peon

    Messages:
    18
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #2
    to make it more clear


    i do not want to submit for the "button" with the name "buttonname"...For some reason i want that button's value...once i submit i shud get "buttonvalue"...wat is wrong with my code???



    
    <form name='rag' action='tt.asp' method='post'>
    <input  type='button' value='butonvalue' name='buttonname' />
    <input type='submit' value='OK' name='submit'/>
    </form>
    
    
    Code (markup):

    tt.asp has this
    
    <%
    response.write request.form("buttonname")
    
    %>
    
    Code (markup):
     
    rag84dec, Feb 6, 2008 IP
  3. kadesmith

    kadesmith Peon

    Messages:
    479
    Likes Received:
    6
    Best Answers:
    0
    Trophy Points:
    0
    #3
    Not positive here on this one, but I don't think that value is a valid attribute of button which would explain why you can't retrieve it's value.
     
    kadesmith, Feb 8, 2008 IP