[phpBB Debug] PHP Notice: in file /includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Notice: in file /includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Notice: in file /includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Notice: in file /includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Notice: in file /includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Notice: in file /includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Notice: in file /includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Notice: in file /includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Notice: in file /includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Notice: in file /includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Notice: in file /includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Notice: in file /includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Notice: in file /includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Notice: in file /includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Notice: in file /includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Notice: in file /includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Notice: in file /includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Notice: in file /includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Notice: in file /includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Notice: in file /includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Notice: in file /includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Notice: in file /includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Notice: in file /includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Notice: in file /includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Notice: in file /includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Notice: in file /includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Notice: in file /includes/bbcode.php on line 112: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Notice: in file /includes/bbcode.php on line 112: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Notice: in file /includes/functions.php on line 4284: Cannot modify header information - headers already sent by (output started at /includes/functions.php:3493)
[phpBB Debug] PHP Notice: in file /includes/functions.php on line 4286: Cannot modify header information - headers already sent by (output started at /includes/functions.php:3493)
[phpBB Debug] PHP Notice: in file /includes/functions.php on line 4287: Cannot modify header information - headers already sent by (output started at /includes/functions.php:3493)
[phpBB Debug] PHP Notice: in file /includes/functions.php on line 4288: Cannot modify header information - headers already sent by (output started at /includes/functions.php:3493)
www.dhtmlgoodies.com • View topic - Click on Content so that it becomes an input field
Page 1 of 1

Click on Content so that it becomes an input field

PostPosted: Wed Jun 28, 2006 4:45 pm
by bb98uk
On Flickr.com they have comments against the photo images that if a user clicks on the text then it changes from standard text to an appropriate input field. When you have moved away from the field it is written to the database - i.e. there is no save button.

This has benefits in that text can be shown in full whereas an input field has a defined size that truncates the full text. Also; if you are writing the changes directly to the database then you are unlikely to lose user data if they do not hit the save button, for example they click the back button or there browser crashes at a later point in the form.

So how do they do that? Can I suggest a script that will present text and on clicking on the text it becomes the appropriate input/textbox/select prompt and then on leaving the field the data is automatically sent to the database....

PostPosted: Fri Jun 30, 2006 1:49 pm
by Batalf

PostPosted: Sun Aug 06, 2006 5:04 pm
by Driesdk
that would be a great script, I dont really think wysiwyg is really needed here, it would be cool allready if they can just write something down, and that is is saved in his cookies. Would be a great addition to the dragable boxes script.
I wish I could code it.

Re: Click on Content so that it becomes an input field

PostPosted: Tue Aug 15, 2006 1:55 am
by saintSR

PostPosted: Thu Aug 24, 2006 7:13 pm
by HatakeKakashi
Lol, I came to see if B had replied to another post I made and while i was looking down the page I realized I already made this one you're talking about.

I did it so that when I edit a form, I can retain past inputed file names. Without this, I could prefill the text areas and change the default radio buttons and such, but the webbrowser won't let the browser set a file choise, so when I bring up the page to edit, I juat show the picture or text of the file name, and then when thats clicked I can edit the page.

All it takes is a hidden input field with value named "changeimg" for example, and then you display whatever you want in a div, and you can then attach
onClick="this.form.changeimg.value='1'; this.form.action='thepageyouwereone.php';"

and then its just a matter of adding an if($_POST['changeimg']==0){draw div with text or image}else{draw input box}



now when you click the div with the text or picture, the page will reload with an input field there now.

On issue you need to make sure is that if you have multiple of these on the page you post and retrieve all the toggling variables, so that you don't lose input fields when you open a new one.


Also, this is a ghetto way of doing it these days, because its not using AJAX to change the div. It is possible to change the div to an input field with ajax, its not that hard, I just haven't gotten around to updating the page with new techniques.