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"
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") %>
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">