473,399 Members | 3,888 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,399 software developers and data experts.

Page to test a text manipulation function

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.

Help?
--
--
Fabian
Visit my website often and for long periods!
http://www.lajzar.co.uk

Jul 20 '05 #1
3 3012
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


Jul 20 '05 #2
Problem solved. I was using = instead of == in some if statements.

Thanks for your help, everyone who replied to this thread. You were
great. Couldn't have done it without you guys.
--
--
Fabian
Visit my website often and for long periods!
http://www.lajzar.co.uk

Jul 20 '05 #3
JRS: In article <bn*************@ID-174912.news.uni-berlin.de>, seen in
news:comp.lang.javascript, Fabian <la****@hotmail.com> posted at Wed, 29
Oct 2003 13:55:08 :-
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.

<URL:http://www.merlyn.demon.co.uk/js-quick.htm> does not do that; but
it uses techniques required to do that, and is reasonably short. View
Source. Make F.Result a textbox like F.Code.

--
© John Stockton, Surrey, UK. ?@merlyn.demon.co.uk Turnpike v4.00 IE 4 ©
<URL:http://jibbering.com/faq/> Jim Ley's FAQ for news:comp.lang.javascript
<URL:http://www.merlyn.demon.co.uk/js-index.htm> JS maths, dates, sources.
<URL:http://www.merlyn.demon.co.uk/> TP/BP/Delphi/JS/&c., FAQ topics, links.
Jul 20 '05 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: Andrew Poulos | last post by:
Say I have a page, which has been created by a third party, and the page may contain some pre-specified text. How can I find and replace that text dynamically? For example, if the page I have...
8
by: DKM | last post by:
Here are the source code files to a Java applet that utilizes LiveConnect to communicate with Javascript, and the HTML file. The thing works both in IE 6.0 and FireFox 1.4. but with some...
0
by: 42 | last post by:
I implemented a simple class inherited from Page to create a page template. It simply wraps some trivial html around the inherited page, and puts the inherited page into a form. The problem I...
9
by: tshad | last post by:
This is from my previous post, but a different issue. I have the following Javascript routine that opens a popup page, but doesn't seem to work if called from an asp.net button. It seems to work...
2
by: Kiyomi | last post by:
Hello, I have some codes under event ButtonSend_Click to check the user input values. This check is complicated enough using different stored procedures. Then according the result of the...
19
by: thisis | last post by:
Hi All, i have this.asp page: <script type="text/vbscript"> Function myFunc(val1ok, val2ok) ' do something ok myFunc = " return something ok" End Function </script>
2
by: vunet.us | last post by:
Hello JavaScript experts, I have a floating div which I drag all over the page. If the page has scrollbars and users drag the floating div to the very top, page scrolls up too. The problem occurs...
0
by: peridian | last post by:
Hi, I wanted a web page where I could post code to, and have it appear in coloured formatting based on the context of the code. Most of the techniques I have seen for this involve complex use...
2
by: Msleh08 | last post by:
Hello. The code below shows a basic html text file with a highlighted bar that scrolls over each <tr> using your up/down arrow. If you notice, when you scroll using your up/down arrow the page jerks....
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.