Hi All,
I have an issue with setting a JavaScript variable to session. This is a
string and I need to retrieve this in my Action Class and process further. I am using
Struts 1.1.
I have tried setting this variable as a hidden variable however, it doesn't reach the Action Class - I get a null value.
Any suggestions on what I would need to do?
Here's the gist of what I am trying to do:
JSP:
<html>
<body>
<input type="hidden" name="userInfo" />
<input type="submit" onclick="submit();" value="Submit">
<input type="submit" onclick="cancel();" value="Cancel">
<form>
....
....
....
//make a call to foo()
</form>
<script>
function foo() {
var bar = "Divya";
document.getElementsByTagName("userInfo").value = bar;
}
</script>
</body>
</html>