[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
Advertisement

Click on Content so that it becomes an input field

Moderator: Calcifer

Click on Content so that it becomes an input field

Postby bb98uk » Wed Jun 28, 2006 4:45 pm

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....
bb98uk
 
Posts: 4
Joined: Wed Jun 28, 2006 4:37 pm

Postby Batalf » Fri Jun 30, 2006 1:49 pm

Batalf
Site Admin
 
Posts: 2160
Joined: Sat Oct 22, 2005 9:38 pm

Postby Driesdk » Sun Aug 06, 2006 5:04 pm

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.
Driesdk
 
Posts: 4
Joined: Sat Aug 05, 2006 10:16 pm

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

Postby saintSR » Tue Aug 15, 2006 1:55 am

saintSR
 
Posts: 61
Joined: Wed Aug 09, 2006 5:19 pm
Location: Atlanta GA, USA

Postby HatakeKakashi » Thu Aug 24, 2006 7:13 pm

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.
HatakeKakashi
 
Posts: 27
Joined: Tue Aug 01, 2006 7:33 pm


Return to Request/Suggest a script by posting in this thread

Who is online

Users browsing this forum: No registered users and 0 guests

cron