Go4Expert

Go4Expert (http://www.go4expert.com/)
-   Web Design, HTML And CSS Forums (http://www.go4expert.com/forums/web-design-forum/)
-   -   Getting the button's value (http://www.go4expert.com/forums/getting-buttons-value-t8683/)

rag84dec 6Feb2008 15:24

Getting the button's value
 
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"

rag84dec 6Feb2008 15:38

Re: Getting the button's value
 
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")

%>


pradeep 6Feb2008 15:49

Re: Getting the button's value
 
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">



All times are GMT +5.5. The time now is 23:36.