Page 1 of 1

[PHP / AJAX] When using html; area not editable

Posted: Sun Oct 01, 2006 9:05 am
by thiscatis
Weirdan | Please use

Code: Select all

,

Code: Select all

and [syntax="..."] tags where appropriate when posting code. Your post has been edited to reflect how we'd like it posted. Please read:  [url=http://forums.devnetwork.net/viewtopic.php?t=21171]Posting Code in the Forums[/url] to learn how to do it too.[/color]


Hi!

I'm using AJAX to edit a field on a test page

[syntax="html"]
<html>
<head>
	<title>test</title>
	<style type="text/css">
		/* Define the basic CSS used by EditInPlace */
		.eip_mouseover { background-color: #ff9; padding: 3px; }
		.eip_savebutton { background-color: #36f; color: #fff; }
		.eip_cancelbutton { background-color: #000; color: #fff; }
		.eip_saving { background-color: #903; color: #fff; padding: 3px; }
		.eip_empty { color: #afafaf; }
	</style>
	<script type="text/javascript" src="prototype.js"></script>
	<script type="text/javascript" src="EditInPlace.js"></script>
	<script type="text/javascript">
		Event.observe(window, 'load', init, false);
		function init() {
			// Over ride some of the default options.
			EditInPlace.defaults['type'] = 'text';
			EditInPlace.defaults['save_url'] = 'edit.php';

			
			// Textarea example.
			EditInPlace.makeEditable({ id: 'bigedit', type: 'textarea' });
		}
	</script>
</head>
<body>
<p>
<div id="bigedit"><?php echo "$content"; ?></div>
</p>

</body>
</html>
When i'm just using plain text, there's no problem..
But when I give e.g <h1>HEADER</h1> as new content the area isn't editable anymore..
Maybe something wrong then with the <div id> that needs to be edit.. anyone?


Weirdan | Please use[/syntax]

Code: Select all

,

Code: Select all

and [syntax="..."] tags where appropriate when posting code. Your post has been edited to reflect how we'd like it posted. Please read:  [url=http://forums.devnetwork.net/viewtopic.php?t=21171]Posting Code in the Forums[/url] to learn how to do it too.[/color]

Posted: Sun Oct 01, 2006 9:39 am
by thiscatis
hmm..
I've located the problem.
Everytime I add html code between <div> tags the script doesn't recognize it as an editable div id..
Anyone knows how I can fix that?