• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 195
  • Last Modified:

insert chars into textbox

dont know if this is the correct topic area

id like a text box in a form to have a row of buttons underneath it
when u click one of these buttons then a character gets inserted into the text box

say i have a text box and underneath i have
[1] [2] [3] etc....
(ie a button with 1 on it, a button with 2 on it etc

then say i have typed "hello" into the text box and i click the button with 1 on it , then "hello1" appears in the text box and i can go and click submit and "hello1" will be sent to another script.....

is this a javasript kinda question?
if so does anyone know the code to do it? or even better is it a perl issue?


thanks
0
boofulls
Asked:
boofulls
1 Solution
 
guadalupeCommented:
It javscript, heres the answer but next time put it in the Javascript section as I shouldn't really answer it here:


<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2 Final//EN">
<HTML>
<HEAD>
<TITLE> New Document </TITLE>


<SCRIPT LANGUAGE="JavaScript">
<!--//
function change(object,text)
{
      object.value = object.value + text;

}
//-->
</SCRIPT>



</HEAD>

<BODY BGCOLOR="#FFFFFF">


<FORM METHOD=POST ACTION="" name="form1">


<INPUT TYPE="text" NAME="text1" value="">

<input type="button" value="Add text" onClick="change(this.form.text1,'text_to_add')">

<INPUT TYPE="text" NAME="text2" value="">

<input type="button" value="Add text" onClick="change(this.form.text2,'text_to_add2')">
</FORM>


</BODY>
</HTML>
0

Featured Post

Get your problem seen by more experts

Be seen. Boost your question’s priority for more expert views and faster solutions

Tackle projects and never again get stuck behind a technical roadblock.
Join Now