473,385 Members | 1,409 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,385 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 10469
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...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
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: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
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?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...

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.