/    Sign up×
Community /Pin to ProfileBookmark

display text that is entered in a text box

I want to create a text box on my site where a visitor can type in text.But he should be able to see the text in another box on the site as he is typing (at the same time).Something like a online text editor ,but which does not require the pages to be uploaded.

Can anyone help??

to post a comment
PHP

9 Comments(s)

Copy linkTweet thisAlerts:
@NogDogFeb 04.2005 — Not with PHP: it's only processed on the server side, not at the client side (browser). You'd probably have to do something in a Java applet or such.
Copy linkTweet thisAlerts:
@ilyaFeb 04.2005 — maybe flash?
Copy linkTweet thisAlerts:
@NogDogFeb 04.2005 — [i]Originally posted by ilya [/i]

[B]maybe flash? [/B][/QUOTE]

Might qualify as "such." ? (I don't know much about Flash's capabilities.)
Copy linkTweet thisAlerts:
@PSLohFeb 04.2005 — I am not sure what you want, but this should work...

<input type=text name=txtbox onkeyup="txtinput();">

<div id="divinput"></div>

<script language="javascript">

function txtinput(){

divinput.innerHTML="<b>"+ txtbox.value +"</b>";

}

</script>

PSLoh
Copy linkTweet thisAlerts:
@ashokvasauthorFeb 04.2005 — Dear Mr PSLoh,

Thanks for your tip.What I want is that as my visitor is typing in the text box,the same text should appear at the same time(in a font type which can be selected by the user) in another section of the page,just to give the visitor a preview of what he has typed in.I hope I have been able to explain what I want.

Reg the solution given by you,how do you display the text on the screen?Can you give me more details?
Copy linkTweet thisAlerts:
@ashokvasauthorFeb 04.2005 — Dear PSLoh,

Thanks.It worked fine.

But now I made this script and textbox a part of a form and added the form tags,action attribute and submit button.

Now the script does not work.

What needs to be done??
Copy linkTweet thisAlerts:
@cyber1Feb 04.2005 — ashokvas-

I have a similar example but I used a 2 frame frameset.

In the top frame is your edit frame.

The bottom frame displays the text as you type.

Additionally you would need a select list with fonts that can be selected.

If you want to mix font sizes and colors it gets really complicated but can be done.

-Bill
Copy linkTweet thisAlerts:
@PSLohFeb 07.2005 — Hi, perhaps u would like to post your script?...if it is convenient...
Copy linkTweet thisAlerts:
@cyber1Feb 07.2005 — Attached is a small example that I ripped out of one of my Perl scripts and converted to PHP.

Rename with a .php extension and call from the browser.

-Bill

[upl-file uuid=15b9a1dc-eaf7-4516-8ea6-af6110d96aa0 size=2kB]frames_2editor.txt[/upl-file]
×

Success!

Help @ashokvas spread the word by sharing this article on Twitter...

Tweet This
Sign in
Forgot password?
Sign in with TwitchSign in with GithubCreate Account
about: ({
version: 0.1.9 BETA 5.18,
whats_new: community page,
up_next: more Davinci•003 tasks,
coming_soon: events calendar,
social: @webDeveloperHQ
});

legal: ({
terms: of use,
privacy: policy
});
changelog: (
version: 0.1.9,
notes: added community page

version: 0.1.8,
notes: added Davinci•003

version: 0.1.7,
notes: upvote answers to bounties

version: 0.1.6,
notes: article editor refresh
)...
recent_tips: (
tipper: @AriseFacilitySolutions09,
tipped: article
amount: 1000 SATS,

tipper: @Yussuf4331,
tipped: article
amount: 1000 SATS,

tipper: @darkwebsites540,
tipped: article
amount: 10 SATS,
)...