Getting the button's value

rag84dec's Avatar, Join Date: Jul 2007
Go4Expert 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 by rag84dec; 6Feb2008 at 15:24.. Reason: completion
0
rag84dec's Avatar, Join Date: Jul 2007
Go4Expert 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")

%>
0
pradeep's Avatar, Join Date: Apr 2005
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 :
Code: HTML
<input type="hidden" name="nm" value="val">