473,395 Members | 1,456 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,395 software developers and data experts.

Return to location of change after page refresh/form submit

48
need logic so when the page is refreshed that it returns to the location
of the change, not to the top of the page.
Currently, when the page is refreshed, it takes you back to the
beginning of thepage, not the area you may be working on.
What we need the page to do is when enter or tab is pressed and the
page refreshes, take you back to the exact spot on the page you were
at when you pressed enter.when each refresh form submition take place..couls any one plz help?is javascript s help?
May 5 '08 #1

✓ answered by acoder

I can think of at least two ways to do this:

1. You can create a named link, e.g. <a name="text1"> next to each text box, then the form action can be changed to "actionpage.cfm#text1", to jump to the position on the page. You can set this using JavaScript in the onchange.

2. Use a hidden field and change it onchange. When the form is submitted, you can write Coldfusion code to take the hidden field value which is the name of the text box which triggered the update and jump to that position.

Note: you don't need "javascript:" in an onchange, just the JavaScript code itself is sufficient.

Hope that helps. Let me know if you need help implementing this.

7 10471
acoder
16,027 Expert Mod 8TB
You can use either JavaScript or plain HTML, though you could set it via Coldfusion.

Can I confirm one or two things though: is the refresh via a form submission? Is this triggered by pressing tab or enter?

Post some code, so it can be easier to suggest changes/additions.
May 5 '08 #2
CF FAN
48
we using " onchange="javascript:document.form.submit()" in onchange.What i wants is that when i changed somthing in text field thn form submition took place.
a lot of controls in the form.large form..so when a change somthing in textbox then after submition the control will come to tht changed posion.not the focus in tht form control..just show the postion

<input name="text1" type="text" value="#text1#" id="text1" size="15" maxlength="13" onchange="javascript:document.form.submit()"/>
May 7 '08 #3
acoder
16,027 Expert Mod 8TB
I can think of at least two ways to do this:

1. You can create a named link, e.g. <a name="text1"> next to each text box, then the form action can be changed to "actionpage.cfm#text1", to jump to the position on the page. You can set this using JavaScript in the onchange.

2. Use a hidden field and change it onchange. When the form is submitted, you can write Coldfusion code to take the hidden field value which is the name of the text box which triggered the update and jump to that position.

Note: you don't need "javascript:" in an onchange, just the JavaScript code itself is sufficient.

Hope that helps. Let me know if you need help implementing this.
May 7 '08 #4
CF FAN
48
OK thanks............working hidden field logic
May 26 '08 #5
acoder
16,027 Expert Mod 8TB
Do you mean you've got it working or you're going to work with the hidden field option?
May 26 '08 #6
CF FAN
48
I mean it's working now ...sory 4 vauge communication
May 27 '08 #7
acoder
16,027 Expert Mod 8TB
No problem, glad to hear that you've got it working.
May 27 '08 #8

Sign in to post your reply or Sign up for a free account.

Similar topics

19
by: gsb | last post by:
HOW TO: Submit a form to PHP with no return? I need to submit a form for file upload to a PHP script but do not want anything returned. That is the TARGET for the form should be like a null...
10
by: Don | last post by:
I want the server-side php script to return a browser page that is essentially a copy of the original client page that contained the <form> which referenced the php script in the first place....
5
by: Glenn Mulno | last post by:
Hi, I am trying to create a report page for several teams. Each team runs the same reports but the reports use different values. For a while this was getting insane everytime I updated the...
4
by: fig000 | last post by:
Hi, I'm relatively new to Javascript so please bear with me on what might sound like silly questions. This is what I want to do: I'm working in classic asp (I have to for this project). I...
3
by: Al | last post by:
Hi all... I have created an aspx page that contains an animated GIF. I am using javascript and location.replace to redirect from this page to another aspx page which takes several seconds to...
13
by: kurtj | last post by:
Hello Gurus: I have a validation script (below) that is somehow messed up. If the Name field is blank, I get the alert message, then the browser window goes to a blank document with the word...
4
by: d3vkit | last post by:
I have a form on my page, and some javascript which uses ajax to submit the form, and then opens the new page in a div using ajax so there is no refresh. This works fine. But the problem is this: all...
3
by: Anthony | last post by:
I have a form on a web page that requires to click on a button to submit the information. I have two questions about changing this form: 1. Is there a way that I can change the script so that the...
1
by: brendwal | last post by:
Hi, I am stumped at how to do this: I have a simple webform that I want the user to enter one value (an address). I then want the form to send those values to a PHP script that processes the...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.