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 gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

just a little demand for java-pros

Status
Not open for further replies.

Bimmel

Programmer
Feb 15, 2002
19
DE
I am a webmaster and can rock PHP & MYSQL & HTML,
but JAVA is a no-no.
I do not want to learn it just because of this little script I have to include in my page.
There is only something to do with the vars, please put it a correct syntax, this function do not work at all, which means that the textarea does not change:

<script language=&quot;JavaScript&quot;>
<!--

function setcode(Form , Variable , Zeichen) {
document.Form.Variable.value =
document.Form.Variable.value + Zeichen;
}

// --></script>
 
I don't see anything particularly wrong with the function. Are you sure you are calling it correctly. You need to pass it the form, the input field and a value. Like this:
Code:
setcode(this.form,this,3)
I also feel obligated to point out that you are talking about JavaScript NOT Java. There is a HUGE difference!
Tracy Dryden
tracy@bydisn.com

Meddle not in the affairs of dragons,
For you are crunchy, and good with mustard.
 
this should work
Code:
<script language=&quot;JavaScript&quot;> 
<!-- 
	function setcode(Variable , Zeichen)
	{
		Variable.value = Variable.value + Zeichen;
	}
// --></script>
if you have this
<form name=&quot;Form1&quot;>
   <input type=&quot;text&quot; name=&quot;Text1&quot; id=&quot;Text1&quot;>
</form>
then the function is called like this:
setcode(document.Form1.Text1, 'Hi');
 
heh... I never read this message before because its title was to do with java rather than javascript.

There's a difference, just to let you know.
bluebrain.gif
blueuniment.gif
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top