469,275 Members | 1,871 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,275 developers. It's quick & easy.

Some javascript works, others not

pk
I've been working on a page all day and at some point i actually fixed
some of the formatting problems i was having but killed the
functionality. This page queries a SQL server in the back-end and
spits out an answer of sorts. I'm writing this page over an existing
page since the company needs to keep some uniformity. I would like to
show you my problem instead of telling you. It'll make more sense that
way.

Go here.
http://www.bigkaiser.com/phil/e-assist.htm

Go ahead and click solve, it doesn't matter what you put in. It used
to, but not since I broke it. Now it tells me that
'document.kpt.style' is null or not an object. (Line 44, Char 19). I
say it is, and I say that it works on other pages that we use. So why
is it yelling at me?

Thanks a lot for helping. I feel quite needy today :(.

-pk

Aug 31 '05 #1
6 1179
pk
Investigating a bit more I find that Firefox's JavaScript Console tells
me that many objects have no properties. Here is the list of objects
with no properties.

document.getElementById("Finish") has no properties
document.kpt.submit.style has no properties
document.kpt.lit has no properties
document.kpt.bck1 has no properties
document.kpt.fwd1 has no properties

Why does document.kpt.bck have properties while document.kpt.bck1
doesn't?? Same goes for document.kpt.fwd and document.kpt.fwd1. I'm
utterly lost.

Thanks.

-pk

Aug 31 '05 #2
Lee
pk said:

Investigating a bit more I find that Firefox's JavaScript Console tells
me that many objects have no properties. Here is the list of objects
with no properties.

document.getElementById("Finish") has no properties
document.kpt.submit.style has no properties
document.kpt.lit has no properties
document.kpt.bck1 has no properties
document.kpt.fwd1 has no properties

Why does document.kpt.bck have properties while document.kpt.bck1
doesn't?? Same goes for document.kpt.fwd and document.kpt.fwd1. I'm
utterly lost.


What element of your page do you believe can be refered to as "Finish"
or as "document.kpt". I don't find either of them.

Aug 31 '05 #3

pk wrote:
I've been working on a page all day and at some point i actually fixed
some of the formatting problems i was having but killed the
functionality. This page queries a SQL server in the back-end and
spits out an answer of sorts. I'm writing this page over an existing
page since the company needs to keep some uniformity. I would like to
show you my problem instead of telling you. It'll make more sense that
way.

Go here.
http://www.bigkaiser.com/phil/e-assist.htm

Go ahead and click solve, it doesn't matter what you put in. It used
to, but not since I broke it. Now it tells me that
'document.kpt.style' is null or not an object. (Line 44, Char 19). I
say it is, and I say that it works on other pages that we use. So why
is it yelling at me?

Thanks a lot for helping. I feel quite needy today :(.

-pk


Hello pk,

First, I would like you to clean up your code. It's not very readable
(for me anyways).

Secondly, you have a lot of scripts going on in their own script tags.
Glancing at it, this seems entirely unnecessary. Have a single <script
type = "text/javascript"> and place all your code within.

Third, did you know you're doing nested forms? This is a bad practice,
and the forms won't even function correctly. Try to have at least a
valid page before proceeding.

After all this is done, let's try to tackle the problem once again.

I apologize if I couldn't be more helpful.

Aug 31 '05 #4
pk
OK, I totally agree with you that this code is unreadable, but I didn't
know that nested forms were a no-no. I'm looking to create some valid
code from this page but I'm going to need help. I have <form
Name="myform"> nested inside <form Name="kpt"> and I have no idea how
to get away from that without losing the functionality of the "myform"
form.

Lee, in response to your question, perhaps I have the naming
conventions wrong. I'm only editing this page, I didn't create it from
scratch. I thought that something like
"document.kpt.bck1.style.backgroundColor" would refer to the
backgroundColor of button "bck1" in form "kpt" in my document. No?

pk

Sep 1 '05 #5
Lee
pk said:

OK, I totally agree with you that this code is unreadable, but I didn't
know that nested forms were a no-no. I'm looking to create some valid
code from this page but I'm going to need help. I have <form
Name="myform"> nested inside <form Name="kpt"> and I have no idea how
to get away from that without losing the functionality of the "myform"
form.

Lee, in response to your question, perhaps I have the naming
conventions wrong. I'm only editing this page, I didn't create it from
scratch. I thought that something like
"document.kpt.bck1.style.backgroundColor" would refer to the
backgroundColor of button "bck1" in form "kpt" in my document. No?


If you're going to respond to me, you should respond to my post.
Yes, that is the correct convention. I don't find a form named
"kpt" in your document.

Sep 1 '05 #6
pk
Line 114? Or did I name it wrong?

Sep 1 '05 #7

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

reply views Thread by nam | last post: by
4 posts views Thread by Adrienne | last post: by
9 posts views Thread by optimistx | last post: by
11 posts views Thread by Joey | last post: by
reply views Thread by zhoujie | last post: by
reply views Thread by suresh191 | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.