FCKeditor is very useful tool for allowing the user to enter the formatted text in a webpage without having knowledge in HTML.
If we click Back button in the browser once after entering content using FCKeditor, the browser won't go to actual previous page, instead it will remain in samepage with the empty content. We noticed that clicking Back button two times displays correct previous page.
To avoid this issue, we have used below workaround.
- We provided a separate back button in the webpage. In the onclick event of this button, we called a javascript method to simulate clicking of browser back button two times.
- Find below the sample code.
<button onclick="javascript:history.go(-2);">Back</button>
And also, we have noticed that sometimes (e.g. after saving the content) we need to click browser back button 4 times to go the previous page.
To handle this scenario, we can enhance the above sample code by replacing -2 with a PHP variable whose value should be set either -2 or -4.
for example,
- pass a querystring parameter confim=updated once after finishing the save operation.
- use below code to assign value for a php variable based on the flow.
if (isset($_GET['confirm']))
{
$backcount=-4;
}
else
{
$backcount=-2;
}
- Now this php variable can be used in our previous sample code.
<button onclick="javascript:history.go(<?php echo $backcount;?>);"> Back</button>
updates on May 08:
It seems we need to use "return false" as below to avoid issue in some browsers (IE 7 and FireFox).
<button onclick="javascript:history.go(<?php echo $backcount;?>);return false;" > Back</button>
More Articles...
Tuesday, April 28, 2009
Search This Blog
Blog Archive
-
▼
2009
(257)
-
▼
April
(56)
- Ways to improve user experience in any website
- Steps for using FCK editor
- For using javascript Calendar in web page
- Focusing HTML element immediately after loading t...
- How to avoid multiple lines in <td> tag?
- Getting current Page Name in PHP
- PHP function to get the ID generated from the prev...
- Javascript example for selectively displaying part...
- Javascript validation for radio button in HTML form
- Detecting browser type using javascript
- Displaying Random records from MySQL database table
- Handling Date and Time in PHP/MySQL
- Email syntax validation using javascript
- Removing text from Textbox on giving Focus
- Displaying vertical scroll bar dynamically in HTML...
- Doing case insensitive search in C#.Net
- Converting Letter Case in php/MySql
- Doing page redirection in PHP
- Workaround for Back button issue in FCKeditor.
- Quick Introduction to RSS feed/Syndication
- How to detect Plagiarism?
- QTP Learning Steps for Beginners
- MySQL - Resolved null issue in query.
- Resolving delimiter issue in PHP
- PHP - Disabling Display of Notice messages
- Understanding Object Repository in QTP (Quick Test...
- HTML - Displaying Content in the same line using ...
- Basics of QTP (Quick Test Professional)
- Basics of Session and Cookies
- PHP - Resolved the issue of setcookies not setting...
- Importance of Software Testing
- PHP code for preventing session hijacking
- Dynamically changing/displaying web page content u...
- Javascript code for preventing user from copying c...
- SQL query for deleting duplicate records in parent...
- Web Development Best Practices
- C# - Performance difference between use of Datatab...
- URL for checking usage of Broadband provided by BSNL
- How to dynamically change attribute (e.g height) o...
- Best practices in Software Testing
- Importance of Software Test Automation using tool...
- Always explicitly use $_GET when using querystrin...
- How to change Row of Data into Column Data in Excel?
- Free Markup validation service provided by W3C
- Basics of Quality Assurance (QA) in Sofware Develo...
- We are growing firmly with our Vision and Values
- Priority order of Style for HTML tags
- Allowing Users to Change attribute of the HTML tag...
- How to find PageRank (PR) of a web page?
- Creating Captcha using PHP and Handling Captcha us...
- Looking for Trainee Software Engineer
- Resolved the timed out error while using HttpWebRe...
- How to disable Wireless LAN in BSNL Modem?
- HTML - Use "return false" to avoid page jump on c...
- C#- Workaround for inconsistent behaviour of invok...
- Unicode Character for Space and Line Feed
-
▼
April
(56)

AI Course | Bundle Offer | Unlocking AI | Dream Big | Listen to Dream Big
Today's Deals | Timesheet | Products | SQL ebook | Earn 50% commission
About | Privacy | Follow | TOS | WhatsApp | Contact
I may earn a commission from Amazon affiliate links
No comments:
Post a Comment