how to pass the javascript variable value to a jsp

Hi

I am trying to set a javascript variable with onClick event of a radio button in jsp

and I am assigning this variable to a hidden property in JSP whic has the corresponding getter an setter method in form.

But I am not able to retrtieve the value assigned in either form/action .can any body help me in this:

The code is

<script language="javascript">

var jais="";

function setValue(val)

{

jais=val;

}

document.o.value=jais;

</script>

<html:hidden property="o" value=""/>

<input type=radio name="1"

value="xyz"

onclick="setValue('XYZ')" >

ABC

and in the correspoding form bean I have

private String o_val =null;

public String geto()

{

return o_val;

}

public void seto(String strs)

{

o_val=strs;

}

In the action I am trying to access

by

1)String j=((form name)form.geto();

2)String j=request.getParameter("o")

but with both of them I am getting the value null

Thanks in Advance

[1121 byte] By [Jaisa] at [2007-10-2 16:35:16]
# 1
You need to set the value of the hidden field in your function.Setting an unrelated variable will not help.function setValue(val){ document.forms[0].o.value = val;}also your get/set methods should be getO() and setO().
evnafetsa at 2007-7-13 17:40:46 > top of Java-index,Enterprise & Remote Computing,Web Tier APIs...