473,490 Members | 2,495 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

Problem

Hello
I've got: file 'name.html', where are:

<BODY>
<center>
<form type=get action="to.html">
<table border=1>
<tr>
<td>First Name:</td><td><input type=text name=firstname size=10></td>
</tr>
<tr>
<td>Last Name:</td><td><input type=text name=lastname size=10></td>
</tr>
<tr>
<td>Age:</td><td><input type=text name=age size=3></td>
</tr>
<tr>
<td colspan=2><input type=submit value="Submit!">
</td>
</tr>
</table>
</form>
</center>
</body>

in the secound file 'name1.html':

<html>
<HEAD>

<SCRIPT LANGUAGE="JavaScript">

<!-- This script and many more are available free online at -->
<!-- The JavaScript Source!! http://javascript.internet.com -->

<!-- Begin
function getParams() {
var idx = document.URL.indexOf('?');
var params = new Array();
if (idx != -1) {
var pairs = document.URL.substring(idx+1, document.URL.length).split('&');
for (var i=0; i<pairs.length; i++) {
nameVal = pairs[i].split('=');
params[nameVal[0]] = nameVal[1];
}
}
return params;
}
params = getParams();
// End -->
</script>
</HEAD>
<BODY>

<SCRIPT LANGUAGE="JavaScript">

<!-- Begin
firstname = unescape(params["firstname"]);
lastname = unescape(params["lastname"]);
age = unescape(params["age"]);

document.write("firstname = " + firstname + "<br>");
document.write("lastname = " + lastname + "<br>");
document.write("age = " + age + "<br>");
// End -->
</script>
</body>
</html>

When I start my scripts and give values, in name1.html there is text:
undefined. Why? What's wrong?
qpon

Jul 23 '05 #1
4 996
On Sun, 8 Aug 2004 13:50:44 +0200, qpon <qp**********@interia.pl> wrote:
Hello
I've got: file 'name.html', where are:

<BODY>
<center>
This element is deprecated. You should catch up with the times and use
Cascading Style Sheets (CSS) for presentation. See the
comp.infosystems.www.authoring.stylesheets newsgroup for help with CSS. Be
sure to read the FAQ before posting, though.

<URL:http://www.faqs.org/faqs/www/stylesheets/newsgroup-faq/>
<form type=get action="to.html">
This is your problem. The FORM element does not have a type attribute.
What you actually want is the method attribute. Also, you use to.html as
the destination, but you refer to name1.html below. Try:

<form action="name1.html" method="get">

Had you validated your HTML (see <URL:http://validator.w3.org/>), you
would have noticed this.

[snip]
<SCRIPT LANGUAGE="JavaScript">
Valid HTML requires the type attribute. This attribute renders the
deprecated language attribute obsolete.

<script type="text/javascript">
<!-- This script and many more are available free online at -->
<!-- The JavaScript Source!! http://javascript.internet.com -->

<!-- Begin
Hiding script data with SGML comment delimiters is an out-dated practice
that should have disappears years ago. All browsers in use understand the
SCRIPT element, even if they don't execute scripts.
function getParams() {
var idx = document.URL.indexOf('?');
var params = new Array();
if (idx != -1) {
var pairs = document.URL.substring(idx+1,
document.URL.length).split('&');
for (var i=0; i<pairs.length; i++) {
nameVal = pairs[i].split('=');
params[nameVal[0]] = nameVal[1];
}
}
return params;
}
params = getParams();
I really don't like how that's written, but I don't really have time to
change it now. Hopefully, someone else will.
// End -->
This should go, too.
</script>
</HEAD>
<BODY>

<SCRIPT LANGUAGE="JavaScript">

<!-- Begin
[snip]
// End -->


Same comments regarding obsolesence apply here, too.

[snip]

Mike

--
Michael Winter
Replace ".invalid" with ".uk" to reply by e-mail
Jul 23 '05 #2
Try:
<form action="name1.html" method="get">


It doesn't work!

Jul 23 '05 #3
On Sun, 8 Aug 2004 22:01:11 +0200, qpon wrote:
<form action="name1.html" method="get">


It doesn't work!


....err. Did you try it as?

<form action="to.html" method="get">

[ Failing that, try flogging it with
a whip, it might just be lazy. ;-) ]

--
Andrew Thompson
http://www.PhySci.org/ Open-source software suite
http://www.PhySci.org/codes/ Web & IT Help
http://www.1point1C.org/ Science & Technology
Jul 23 '05 #4
> ...err. Did you try it as?

Know it works!
Thanks of all
Jul 23 '05 #5

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

Similar topics

11
3729
by: Kostatus | last post by:
I have a virtual function in a base class, which is then overwritten by a function of the same name in a publically derived class. When I call the function using a pointer to the derived class...
117
7098
by: Peter Olcott | last post by:
www.halting-problem.com
18
6136
by: Ian Stanley | last post by:
Hi, Continuing my strcat segmentation fault posting- I have a problem which occurs when appending two sting literals using strcat. I have tried to fix it by writing my own function that does the...
28
5168
by: Jon Davis | last post by:
If I have a class with a virtual method, and a child class that overrides the virtual method, and then I create an instance of the child class AS A base class... BaseClass bc = new ChildClass();...
6
3784
by: Ammar | last post by:
Dear All, I'm facing a small problem. I have a portal web site, that contains articles, for each article, the end user can send a comment about the article. The problem is: I the comment length...
16
4865
by: Dany | last post by:
Our web service was working fine until we installed .net Framework 1.1 service pack 1. Uninstalling SP1 is not an option because our largest customer says service packs marked as "critical" by...
2
4529
by: Mike Collins | last post by:
I cannot get the correct drop down list value from a drop down I have on my web form. I get the initial value that was loaded in the list. It was asked by someone else what the autopostback was...
0
2927
by: =?Utf-8?B?am8uZWw=?= | last post by:
Hello All, I am developing an Input Methop (IM) for PocketPC / Windows Mobile (PPC/WM). On some devices the IM will not start. The IM appears in the IM-List but when it is selected from the...
1
5099
by: sherifbk | last post by:
Problem description ============== - I have 4 clients and 1 server (SQL server) - 3 clients are Monitoring console 1 client is operation console - Monitoring console collects some data from...
9
3618
by: AceKnocks | last post by:
I am working on a framework design problem in which I have to design a C++ based framework capable of solving three puzzles for now but actually it should work with a general puzzle of any kind and I...
0
6974
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
7146
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
7183
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
7356
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...
1
4878
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...
0
4573
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
3074
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
1389
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...
1
628
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.