Re: Positional problem?
Well, it kind of works... The focus is being set on the correct field, but the browser doesn't scroll the page down to that field. Is it something I am missing? BTJ On Thu, 2003-12-04 at 08:01, John Ferguson Smart wrote: > When we submit the form, we call a Javascript function to set a hidden > field ('target_field'), which is where we want to go on the updated page : > > function submitForm(theForm, actionChoice, targetFieldName) { > setValue(theForm.query, actionChoice); > setValue(theForm.target_field, targetFieldName); > theForm.submit(); > } > > > Then, when we display the page, we use another Javascript function to > scroll to the right place : > > function jumpField(oForm,ofield) { > var i=0; > var elementsLength = oForm.elements.length; > > for ( i=0 ; i <= elementsLength-1 ; i++ ) { > var fName = oForm.elements[i].name; > if ( fName == ofield.name ) { > oForm.elements[i+1].focus(); > break; > } else { > continue; > } > } > } > > Cheers, > > Bjørn T Johansen wrote: > > >Does anyone have any examples? My javascript knowledge isn't where it > >should be yet > > > > > >BTJ > > > >On Wed, 2003-12-03 at 14:49, John Smart wrote: > > > > > >>We did something like that using an extra field (focus) to know where > >>you are and some javascript to place the focus at the right place when > >>the page is redisplayed. > >> > >>Bjørn T Johansen wrote: > >> > >> > >> > >>>I have a number of jsp pages that are longer than one page and if I am > >>>at the bottom of a page and submit the page, I get back at the top of > >>>the page. Is there a way to get back, after the submit, to the place you > >>>were before the submit? > >>> > >>> > >>>Regards, > >>> > >>>BTJ > >>> > >>> > >>>- > >>>To unsubscribe, e-mail: [EMAIL PROTECTED] > >>>For additional commands, e-mail: [EMAIL PROTECTED] > >>> > >>> > >>> > >>> > >>> > >> > >>- > >>To unsubscribe, e-mail: [EMAIL PROTECTED] > >>For additional commands, e-mail: [EMAIL PROTECTED] > >> > >> > >> > > > > > >- > >To unsubscribe, e-mail: [EMAIL PROTECTED] > >For additional commands, e-mail: [EMAIL PROTECTED] > > > > > > - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Positional problem?
Oki, thanks... I will try this... :) BTJ On Thu, 2003-12-04 at 08:01, John Ferguson Smart wrote: > When we submit the form, we call a Javascript function to set a hidden > field ('target_field'), which is where we want to go on the updated page : > > function submitForm(theForm, actionChoice, targetFieldName) { > setValue(theForm.query, actionChoice); > setValue(theForm.target_field, targetFieldName); > theForm.submit(); > } > > > Then, when we display the page, we use another Javascript function to > scroll to the right place : > > function jumpField(oForm,ofield) { > var i=0; > var elementsLength = oForm.elements.length; > > for ( i=0 ; i <= elementsLength-1 ; i++ ) { > var fName = oForm.elements[i].name; > if ( fName == ofield.name ) { > oForm.elements[i+1].focus(); > break; > } else { > continue; > } > } > } > > Cheers, > > Bjørn T Johansen wrote: > > >Does anyone have any examples? My javascript knowledge isn't where it > >should be yet > > > > > >BTJ > > > >On Wed, 2003-12-03 at 14:49, John Smart wrote: > > > > > >>We did something like that using an extra field (focus) to know where > >>you are and some javascript to place the focus at the right place when > >>the page is redisplayed. > >> > >>Bjørn T Johansen wrote: > >> > >> > >> > >>>I have a number of jsp pages that are longer than one page and if I am > >>>at the bottom of a page and submit the page, I get back at the top of > >>>the page. Is there a way to get back, after the submit, to the place you > >>>were before the submit? > >>> > >>> > >>>Regards, > >>> > >>>BTJ > >>> > >>> > >>>- > >>>To unsubscribe, e-mail: [EMAIL PROTECTED] > >>>For additional commands, e-mail: [EMAIL PROTECTED] > >>> > >>> > >>> > >>> > >>> > >> > >>- > >>To unsubscribe, e-mail: [EMAIL PROTECTED] > >>For additional commands, e-mail: [EMAIL PROTECTED] > >> > >> > >> > > > > > >- > >To unsubscribe, e-mail: [EMAIL PROTECTED] > >For additional commands, e-mail: [EMAIL PROTECTED] > > > > > > - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Positional problem?
When we submit the form, we call a Javascript function to set a hidden field ('target_field'), which is where we want to go on the updated page : function submitForm(theForm, actionChoice, targetFieldName) { setValue(theForm.query, actionChoice); setValue(theForm.target_field, targetFieldName); theForm.submit(); } Then, when we display the page, we use another Javascript function to scroll to the right place : function jumpField(oForm,ofield) { var i=0; var elementsLength = oForm.elements.length; for ( i=0 ; i <= elementsLength-1 ; i++ ) { var fName = oForm.elements[i].name; if ( fName == ofield.name ) { oForm.elements[i+1].focus(); break; } else { continue; } } } Cheers, Bjørn T Johansen wrote: Does anyone have any examples? My javascript knowledge isn't where it should be yet BTJ On Wed, 2003-12-03 at 14:49, John Smart wrote: We did something like that using an extra field (focus) to know where you are and some javascript to place the focus at the right place when the page is redisplayed. Bjørn T Johansen wrote: I have a number of jsp pages that are longer than one page and if I am at the bottom of a page and submit the page, I get back at the top of the page. Is there a way to get back, after the submit, to the place you were before the submit? Regards, BTJ - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] -- John Ferguson Smart, PhD Directeur de Projet Département informatique Communicante AACOM email : [EMAIL PROTECTED] - AACOM - L'Informatique communicante 120 rue du Marin Blanc - Z.I. des Paluds 13685 Aubagne Cedex tel : 04.42.72.65.69 - fax : 04.42.72.65.68 Web : http://www.aacom.fr - - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Positional problem?
Does anyone have any examples? My javascript knowledge isn't where it should be yet BTJ On Wed, 2003-12-03 at 14:49, John Smart wrote: > We did something like that using an extra field (focus) to know where > you are and some javascript to place the focus at the right place when > the page is redisplayed. > > Bjørn T Johansen wrote: > > >I have a number of jsp pages that are longer than one page and if I am > >at the bottom of a page and submit the page, I get back at the top of > >the page. Is there a way to get back, after the submit, to the place you > >were before the submit? > > > > > >Regards, > > > >BTJ > > > > > >- > >To unsubscribe, e-mail: [EMAIL PROTECTED] > >For additional commands, e-mail: [EMAIL PROTECTED] > > > > > > > > > > - > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] > - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Positional problem?
We did something like that using an extra field (focus) to know where you are and some javascript to place the focus at the right place when the page is redisplayed. Bjørn T Johansen wrote: I have a number of jsp pages that are longer than one page and if I am at the bottom of a page and submit the page, I get back at the top of the page. Is there a way to get back, after the submit, to the place you were before the submit? Regards, BTJ - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Positional problem?
I once had the same problem. I overcame it using embedded links in the page, submitting the name of the link to be scrolled to as a hidden form element and placing a redirect in the onload property of the body tag. It worked, but it wasn't fantastic. You may be able to use javascript to get the scroll position from the window object and pass that in the form, although that may introduce cross-browser compatibility issues. Paul Global Equity Derivatives Technology Deutsche Bank [/] Office +44 (0)20 754 55458 Mobile +44 (0)7736 299483 Fax +44 (0)20 7547 2752 Bjørn T Johansen <[EMAIL PROTECTED]> To: Struts Users Mailing List <[EMAIL PROTECTED]> cc: 03/12/2003 13:13 Subject: Positional problem? Please respond to "Struts Users Mailing List" I have a number of jsp pages that are longer than one page and if I am at the bottom of a page and submit the page, I get back at the top of the page. Is there a way to get back, after the submit, to the place you were before the submit? Regards, BTJ - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] -- This e-mail may contain confidential and/or privileged information. If you are not the intended recipient (or have received this e-mail in error) please notify the sender immediately and destroy this e-mail. Any unauthorized copying, disclosure or distribution of the material in this e-mail is strictly forbidden. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Positional problem?
I have a number of jsp pages that are longer than one page and if I am at the bottom of a page and submit the page, I get back at the top of the page. Is there a way to get back, after the submit, to the place you were before the submit? Regards, BTJ - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]