Fabian hu kiteb:
I have created a javascript to manipulate a text strong given to it.
It works in all the situations I put it in. Now, I want to create a
form based interface. Essentially, the use types in the text in a
form text box, and it returns the manipulated text.
Ideally, I'd like it to return teh text in teh same page, without
reloading anything from the server. Problem is, I have no idea how to
capture anything entered into a form with javascript.
ok, Ive found a script online which does mostly what i want. The problem
now, is weird.
---snip---
<SCRIPT LANGUAGE="JavaScript" SRC="numri.js">
</SCRIPT>
<SCRIPT LANGUAGE="JavaScript" SRC="numri-jp.js">
</SCRIPT>
<SCRIPT LANGUAGE="JavaScript">
<!--
function response() {
var newtitle = document.form1.NumberInput.value;
var head1 = document.getElementById("head1");
en_uk.firstChild.nodeValue = numri(newtitle);
jp_ka.firstChild.nodeValue = numri-jp(newtitle);
}
function Xejn() { }
// -->
</SCRIPT>
<form name="form1">
<input type="text" name="NumberInput" size="25">
<input type="button" value="Change!" onClick="response();">
</form>
<HR>
<P>British English:<SPAN ID="en_uk"> </SPAN></P>
<P>Japanese:<SPAN ID="jp_ka"> </SPAN></P>
---snip---
The first two scripts loaded are rather convoluted text manipulation
scripts, for English and Japanese, respectively. The problem is that the
page utterly fails to find the numri-jp function. I can't see why not.
If I add the following line (and delete the numri-jp.js reference), it
won't work.
<SCRIPT LANGUAGE="JavaScript">
function numri-jp(i) {
return i;
}
</SCRIPT>
BUT if I then change all refernces to numri-jp() to numrijp(), it will
find the function. What's up with that?
--
--
Fabian
Visit my website often and for long periods!
http://www.lajzar.co.uk