Print Page | Close Window

Javascript target prob

Printed From: Web Wiz Forums
Category: General Discussion
Forum Name: Web Design Discussion
Forum Description: Discussion on web design and development subjects.
URL: https://forums.webwiz.net/forum_posts.asp?TID=9224
Printed Date: 28 March 2026 at 1:23am
Software Version: Web Wiz Forums 12.08 - https://www.webwizforums.com


Topic: Javascript target prob
Posted By: jimidy
Subject: Javascript target prob
Date Posted: 25 January 2004 at 9:00am

I have a page similar to what I'm typing in now, I want to be able to add 'Formatted' Text to my page..

I'm using a Java script that adds the tags to a prompt box, its works fine how ever it submits it to a new page rather than add it too my text field which is called 'Page1'..   any ideas?

The script which i'm putting in the /HEAD

<SCRIPT language="JavaScript">

function doPrompt()
{
 var yourName
 yourName = window. prompt("Please enter text to be Bold formatted.")
 document.write("<b>" + yourName + "</b>")
}
</SCRIPT>

The hyperlink.

<a href="#" onclick="doPrompt();">Bold</a>

 

Many thanks in advance.. 



-------------
www.srp.me.uk



Replies:
Posted By: dj air
Date Posted: 16 February 2004 at 3:21pm

Try this

function doPrompt()
{
 var yourName
 yourName = window. prompt("Please enter text to be Bold formatted.")
 document.Form name.Page1.value += "<b>" + yourName + "</b>"
}




Print Page | Close Window

Forum Software by Web Wiz Forums® version 12.08 - https://www.webwizforums.com
Copyright ©2001-2026 Web Wiz Ltd. - https://www.webwiz.net