Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Information insert

Status
Not open for further replies.

Extreme43

Programmer
Dec 21, 2004
23
AU
Hello,
im not to good at javascript but
how would i make a make a function so i click a link with this code
<a Href='#' onClick=";?>"sendText(document.form1.text, 'Insert Text Here to textfield')">

and it asks what to insert and inserts it into a text field


--
ps: im not too good at explaining
 
<a href="#" onClick="document.formName.textFieldName.value=prompt('What do you want to say?')">Add text</a>

Programming today is a race between software engineers striving to build better and bigger idiot-proof programs, and the Universe trying to produce bigger and better idiots. So far, the Universe is winning. - Rick Cook (No, I'm not Rick)

zen.gif
 
sorry for double posting but i dont think theirs an edit button

anyway
i have done this and it works great BUT !

how would i insert "<img>" before the users text is inserted and put a "</img>" after it
 
Do you mean this?
Code:
<a href="#" onClick="document.formName.textFieldName.value = [red]'<img>'[/red] + prompt('What do you want to say?') + [red]'</img>'[/red]; return false;">Add text</a>

--Chessbot

"In that blessed region of Four Dimensions, shall we linger on the threshold of the Fifth, and not enter therein? Ah, no! [...] Then, yielding to our intellectual onset, the gates of the Sixth Dimension shall fly open; after that a Seventh, and then an Eighth -- --" Flatland, A. Square (E. A. Abbott)
 
yea sweet thanks alot

but

also
how would i make it to insert that after all the current text in the textbox

ps: thats final question for now :p
 
Code:
<a href="#" onClick="document.formName.textFieldName.value [red]+[/red]= '<img>' + prompt('What do you want to say?') + '</img>'; return false;">Add text</a>

--Chessbot

"In that blessed region of Four Dimensions, shall we linger on the threshold of the Fifth, and not enter therein? Ah, no! [...] Then, yielding to our intellectual onset, the gates of the Sixth Dimension shall fly open; after that a Seventh, and then an Eighth -- --" Flatland, A. Square (E. A. Abbott)
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top