Re: Hidden form fields not found in request

2007-10-26 Thread Hassan Schroeder
On 10/26/07, Ashok Venkat <[EMAIL PROTECTED]> wrote:
> I want to save the dimensions. After the form is posted i call a servlet to 
> save the dimensions. I will look into using Ajax.

For something like this, check out DWR -- Direct Web Remoting --
at  

-- 
Hassan Schroeder  [EMAIL PROTECTED]

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



Re: Hidden form fields not found in request

2007-10-26 Thread David kerber

Propes, Barry L wrote:

I wonder if the name or value params require double quotes? I seem to have had 
a similar issue one time.
  
That would be the first thing to try; I *always* use them for the name 
and value attributes...





-Original Message-
From: Ashok Venkat [mailto:[EMAIL PROTECTED]
Sent: Thursday, October 25, 2007 9:50 PM
To: users@tomcat.apache.org
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 )
{
%>


Please wait one moment...








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;
}




<%
}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]



  




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



Re: Hidden form fields not found in request

2007-10-26 Thread Ashok Venkat
I want to save the dimensions. After the form is posted i call a servlet to 
save the dimensions. I will look into using Ajax.

Appreciate the help.

- Original Message 
From: Pid <[EMAIL PROTECTED]>
To: Tomcat Users List 
Sent: Friday, October 26, 2007 1:35:23 AM
Subject: Re: Hidden form fields not found in request

Ognjen Blagojevic wrote:
> Hi Ashok,
> 
> Ashok Venkat wrote:
>> 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. 
> 
> Interesting. I treied it, and Firefox stops on JavaScript error in line
> 
>  this_form.BrowserType.value = navigator.appName;
> 
> so the form never gets submitted. After adding one more hidden field:
> 
>  
> 
> everything works fine.
> 
> 
> Regards,
> Ognjen

It looks like a nasty and somewhat unsafe solution to some problem or
other.  Is there a reason you need to submit the page at all?

If you're submitting the page to itself, AND using javascript, why not
just use the scripting to alter the contents of the hidden fields?

They can be uniquely identified on the page if you supply an id
attribute - you could modify them directly...


Alternatively, if you're just testing a concept at this stage, I'd
suggest that you could use an AJAX call to submit the page dimensions to
a backend during onloads execution.


p



>> Thanks for any help
>>
>> Code:
>> //test.jsp
>>
>> if(request.getParameter( "ScreenResolutionHeight" ) == null )
>> {
>> %>
>> 
>> 
>> Please wait one moment...
>> 
>> 
>>
>> 
>> 
>> 
>>
>> 
>> 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;
>> }
>> 
>>
>> 
>> 
>> <%
>> }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]
> 
> 


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

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

RE: Hidden form fields not found in request

2007-10-26 Thread Propes, Barry L
I wonder if the name or value params require double quotes? I seem to have had 
a similar issue one time.



-Original Message-
From: Ashok Venkat [mailto:[EMAIL PROTECTED]
Sent: Thursday, October 25, 2007 9:50 PM
To: users@tomcat.apache.org
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 )
{
%>


Please wait one moment...








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;
}




<%
}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]



Re: Hidden form fields not found in request

2007-10-26 Thread Pid
Ognjen Blagojevic wrote:
> Hi Ashok,
> 
> Ashok Venkat wrote:
>> 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. 
> 
> Interesting. I treied it, and Firefox stops on JavaScript error in line
> 
>   this_form.BrowserType.value = navigator.appName;
> 
> so the form never gets submitted. After adding one more hidden field:
> 
>   
> 
> everything works fine.
> 
> 
> Regards,
> Ognjen

It looks like a nasty and somewhat unsafe solution to some problem or
other.  Is there a reason you need to submit the page at all?

If you're submitting the page to itself, AND using javascript, why not
just use the scripting to alter the contents of the hidden fields?

They can be uniquely identified on the page if you supply an id
attribute - you could modify them directly...


Alternatively, if you're just testing a concept at this stage, I'd
suggest that you could use an AJAX call to submit the page dimensions to
a backend during onloads execution.


p



>> Thanks for any help
>>
>> Code:
>> //test.jsp
>>
>> if(request.getParameter( "ScreenResolutionHeight" ) == null )
>> {
>> %>
>> 
>> 
>> Please wait one moment...
>> 
>> 
>>
>> 
>> 
>> 
>>
>> 
>> 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;
>> }
>> 
>>
>> 
>> 
>> <%
>> }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]
> 
> 


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



Re: Hidden form fields not found in request

2007-10-26 Thread Johnny Kewl


---
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  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: 
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 )
{
%>


Please wait one moment...








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;
}




<%
}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]



Re: Hidden form fields not found in request

2007-10-26 Thread Ognjen Blagojevic

Hi Ashok,

Ashok Venkat wrote:
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. 


Interesting. I treied it, and Firefox stops on JavaScript error in line

  this_form.BrowserType.value = navigator.appName;

so the form never gets submitted. After adding one more hidden field:

  

everything works fine.


Regards,
Ognjen


 
Thanks for any help


Code: 


//test.jsp

if(request.getParameter( "ScreenResolutionHeight" ) == null )
{
%>


Please wait one moment...








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;
}




<%
}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]