1. We have moved from vBulletin to XenForo and you are viewing the site in the middle of the move. Though the functional aspect of everything is working fine, we are still working on other changes including the new design on Xenforo.
    Dismiss Notice

Getting the button's value

Discussion in 'Web Design, HTML And CSS Forums' started by rag84dec, Feb 6, 2008.

  1. rag84dec

    rag84dec New Member

    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

    Code:
    <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>
    
    
    tt.asp contains
    Code:
    <html>
    
    <%
    response.write request.form("Slskdfh")
    
    response.write request.form("ra")
    %></html>
    

    i want to get "Saks"
     
    Last edited: Feb 6, 2008
  2. rag84dec

    rag84dec New Member

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



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

    tt.asp has this
    Code:
    <%
    response.write request.form("buttonname")
    
    %>
    
     
  3. pradeep

    pradeep Team Leader

    In case of a button the value is sent over only if it is clicked, so if you want some value to be posted with your form, use :
    HTML:
    <input type="hidden" name="nm" value="val">
    
     

Share This Page