Link to home
Start Free TrialLog in
Avatar of Aidam-Unlimited
Aidam-UnlimitedFlag for United Kingdom of Great Britain and Northern Ireland

asked on

jquery jeditable - refresh page after saving specific field

Hello,

I am using jQuery Jeditable plug-in for in-place editing.

http://www.appelsiini.net/projects/jeditable

In one website I have four different jeditable fields.

| title || value || value2 || value 3 || live link: a href $title.html |

I'd like to automatically refresh whole page after first field - Title is edited through Jeditable and clicked Save button. It is for last field - a href $title.html to be updated with new title value.

Code I am using is below.

Thanks for any ideas!

Cheers
Adam

$(".el_wrap .c2 p").editable("./core/save-title.php", { 
      indicator : "<img src='./images/indicator.gif'>",
      tooltip   : "Click to edit...",
      submit    : 'Save',		
});


// HTML just to be clear
<div class="el_wrap">
	<div class="c2">
		<p><? echo $row['title'] ?></p>
	</div>
	
	<div class="c1">
		<ul>
			<li><a href="./<? echo $row['title']; ?>.html">Products</a></li>
		</ul>
	</div>
</div>

Open in new window

Avatar of racmail2001
racmail2001
Flag of Romania image

can you try this?

$(".el_wrap .c2 p").editable("./core/save-title.php", {
      indicator : "<img src='./images/indicator.gif'>",
      tooltip   : "Click to edit...",
      submit    : 'Save',              
}).ready(function() {location.reload();
});

hope it helps
Avatar of Aidam-Unlimited

ASKER

Hi, thanks but it is refreshing page in a loop without clicking anywhere...
ASKER CERTIFIED SOLUTION
Avatar of racmail2001
racmail2001
Flag of Romania image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Many thanks to your suggestion I've done it exactly as I needed.

If anybody would like to see a solution:
$(".el_wrap .c2 p").editable("./core/save-title.php", { 
      indicator : "<img src='./images/indicator.gif'>",
      tooltip   : "Click to edit...",
     	submit  : 'Save',
		 cssclass : 'jedi',
		 callback : function() {
					location.reload();
     				}
  });

Open in new window

Thank you!!