---------------------------------------------------------------------------
HARBOR: http://coolharbor.100free.com/index.htm
Now Tomcat is also a cool application server
---------------------------------------------------------------------------

Hi there.... What I suggest you do is get FireFox and the FireBug plugin, and then debug the script.
Javascript can be extremely tricky.
Alternatively stick alerts in your code so you can see the script invoking.

Just looking at this I cant see the </form> close tag.
Also I think its better to stick the script in the Headers, so that you sure the browser picks up on it before the onload...

Get a debugger, its the only way to get it right... if you have an old version of MS interdev, that will also work.

Good luck...


----- Original Message ----- From: "Ashok Venkat" <[EMAIL PROTECTED]>
To: <users@tomcat.apache.org>
Sent: Friday, October 26, 2007 4:49 AM
Subject: Hidden form fields not found in request


Hello,

In the below code, i am submitting a form to itself in the onload method and changing some hidden form field values. After the form is submitted, the hidden values are not available in the request object.As a result, the page gets into an endless loop.

Thanks for any help

Code:

//test.jsp

if(request.getParameter( "ScreenResolutionHeight" ) == null )
{
%>
<html>
<head>
<title>Please wait one moment...</title>
</head>
<body onload='SubmitOnLoad();'>

<form method='post' id='ScreenResolutionForm'>
<input type='hidden' name='ScreenResolutionWidth' value='1024'>
<input type='hidden' name='ScreenResolutionHeight' value='768'>

<script>
function SubmitOnLoad()
{
var this_form = FindElementById( 'ScreenResolutionForm' );
this_form.ScreenResolutionWidth.value = window.screen.availWidth;
this_form.ScreenResolutionHeight.value = window.screen.availHeight;
this_form.BrowserType.value = navigator.appName;


this_form.submit();
}

function FindElementById( id )
{
if( document.getElementById )
{
return document.getElementById( id );
}
else if (document.layers)
{
return document.layers[id];
}
else if (document.all)
{
return document.all[id];
}

return undefined;
}
</script>

</body>
</html>
<%
}else {
............

__________________________________________________
Do You Yahoo!?
Tired of spam?  Yahoo! Mail has the best spam protection around
http://mail.yahoo.com


---------------------------------------------------------------------
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to