Web Design and Development Forums

MULTIPLE LIVE PREVIEWS of form

This is a discussion on "MULTIPLE LIVE PREVIEWS of form" within the JavaScript Forum section. This forum, and the thread "MULTIPLE LIVE PREVIEWS of form are both part of the Program Your Website category.


Go Back   Webforumz.com > Program Your Website > JavaScript Forum

Welcome to Webforumz.com.
Register Now Register now!

Reply
 
LinkBack Thread Tools Rate Thread
Old Apr 16th, 2008, 15:45   #1 (permalink)
New Member
 
Join Date: Apr 2008
Location: missouri
Posts: 1
Smile MULTIPLE LIVE PREVIEWS of form

Hi,

I've got this script that shows a live real time preview of text typed in a form input area.
<script>
function preview(id1, id2){
var NewText = document.getElementById(id1).value;
splitText = NewText.split(/\n/).join("<br />");
var DivElement = document.getElementById(id2);
DivElement.innerHTML = splitText;}
</script>


BODY

There are two regions, one for the form and the other for the corresponding Preview area.

<form action="#">
<label>Address:</label>
<input type="text" id="address" onKeyUp="preview('address', 'preview-address');" />
</form>

<h1>Preview</h1>
<dl>
<dt>Address:</dt>
<dd id="preview-address"></dd>
</dl>

Well, how can I get more Preview areas? If I try copying the preview areas code twice, I still get just one preview. Can anyone get this, and show more than on multiple previews of the text typed in a form, cool...

Example:

Color: ________

So when you type in the Color form field, say

Color : Red

Then in the form Preview, what to do so that it appears twice or more like this:

Previews:

Red

Red

Red

Thanks and have a great time.
starshine is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
Old Apr 17th, 2008, 00:25   #2 (permalink)
Nerdy Moderator
 
CloudedVision's Avatar
 
Join Date: Feb 2008
Location: In My Own Little World
Age: 14
Posts: 517
Blog Entries: 4
Re: MULTIPLE LIVE PREVIEWS of form

Something like this?

Code: Select all
 function preview(id1, id2,id3,id4){
              var NewText = document.getElementById(id1).value;
              splitText = NewText.split(/\n/).join("<br />");
DivElement = document.getElementById(id2);
              DivElement.innerHTML = splitText;
DivElement = document.getElementById(id3);
               DivElement.innerHTML = splitText;
DivElement = document.getElementById(id4);
               DivElement.innerHTML = splitText;}
__________________
Take it easy

Other Road Design

WebForumz Moderator: HTML | Javascript | PHP
CloudedVision is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Similar Threads
Thread Thread Starter Forum Replies Last Post
multiple form field calculation thenamenoonehastaken JavaScript Forum 2 Feb 21st, 2008 22:32
Multiple DDLs populating different fields in a form foundsheep ASP.NET Forum 0 Feb 14th, 2008 15:58
my movies display as thumbnail previews griffonwing Flash & Multimedia Forum 6 Jan 28th, 2008 15:29
Multiple email reciepents with html form smokieisgod HTML Forum 3 Oct 15th, 2005 22:40
Multiple Choice Form Values Andy K PHP Forum 9 Aug 30th, 2005 12:01



Latest Updates

All Points SEO Security Advisory - CHECK YOUR SITE NOW!

Creative Coding :: February 2008

Webforumz is sponsored by: WESH UK Web Hosting
All times are GMT. The time now is 11:33.

Sleep Study Scoring :: Free Bet :: Website Templates :: Online Betting :: Bookmakers :: Funny Quotes :: Internet Recruitment Software :: Microsoft CRM Experts :: Online Casino :: Decorated Christmas Trees :: Midwife Forums :: Football Betting :: Ecommerce Software :: Web Hosting :: Football Stats :: Dry Cleaning Collection :: xtreme wales - extreme clothing :: Apuestas :: Sharepoint Consultants :: Website Optimisation :: Office Clearance London :: Sharepoint Experts :: Sports Betting :: Casino :: Website Templates :: Web Design Development India :: Online Gambling

Powered by: vBulletin Version 3.7, Copyright ©2000 - 2008, Jelsoft Enterprises Limited.
© 2003-2008 Webforumz.com : All Rights Reserved
Search Engine Friendly URLs by vBSEO 3.2.0 RC6


1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59