473,757 Members | 2,320 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

value is null or not an object -- after a few submits

AC
This code works great the first few times it is used in a form and then I
get the error:
'QUANTITY.value ' is null or not an object in IE6.

The names used are generated on the server so it is not code that changes
due to being handwritten. I can't see any reason why this does work at
first then fails after a few uses. It is weird that it works perfectly but
after a few attempts it stops working.
**THE CALLER:
note there are some hidden fields but they are not used in this code.
=============== =============== ======
<tr>
<FORM NAME='frmOrder3 9ea'>
<td width='50' valign='middle' align='center'> <font size=-1>
<input type='text' size='3' name='QUANTITY' value='0'
onChange='this. value=CKquantit y(this.value)'> </input>&nbsp;</font></td>
</FORM>

<FORM NAME='frmOrder3 9bx'>
<td width='53' valign='middle' align='center'> <font size=-1>
<input type='text' size='3' name='QUANTITY'
value='0'></input>&nbsp;</font></td>
</FORM>
<FORM NAME='frmSubmit Me39'>
<td>
<input type="button" value="Buy"
onClick="Proces sBuys(document. forms['frmOrder39ea'],
document.forms['frmOrder39bx'])">
</td>
</FORM>
</tr>
=============== =============== ======

**THE FUNCTON:
takes the two forms above and then works on them.
The line with the error is commented below.
=============== =============== ======
function ProcessBuys(fir st, second) { //, second) { //Handles multiple items

//alert('1p- '+first.PRICE.v alue+' -1p 2p- '+second.PRICE. value+' -2p
1q- '+first.QUANTIT Y.value+' -1q 2q-'+second.QUANTI TY.value+' -2q' );

if (! first){
alert('first object is null');
return false;
}
else {
if (first.QUANTITY .value!=null){ // <---- ERROR IS ON THIS LINE
if(first.QUANTI TY.value>0){
AddToCart(first );
//alert('bye '+first.name+' bye');
}
}
else {
alert('first quantity is null');
}
}

if (second.QUANTIT Y.value!=null){
if(second.QUANT ITY.value>0){
AddToCart(secon d);
//alert('abt '+first.name+' abt');
}

return false;
}

first=null;
second=null;

return true;
}
=============== =============== ======
*************** *************** ***********
Jul 20 '05 #1
6 6266
"AC" <AC@No.spam> wrote in message
news:hw******** ***********@nwr dny03.gnilink.n et...
<snip>
<tr>
<FORM NAME='frmOrder3 9ea'>

<snip>

Valid HTML 4 requires (by official DTD) a form element to have an action
attribute and forms may not be children of TR elements. Without starting
with valid HTML there is no reason to expect javascript to be able to
interact successfully with the resulting DOM.

Richard.
Jul 20 '05 #2
AC
So you're saying:

1) I need to have an action for the form. I can do that by creating an
action I won't use.

2) I can't have a form(s) in a table? Do you mean I should use CSS?

Thanks for the info. Could you supply some ideas about what I should change
the code to?
-AC

"Richard Cornford" <Ri*****@litote s.demon.co.uk> wrote in message
news:c1******** ***********@new s.demon.co.uk.. .
"AC" <AC@No.spam> wrote in message
news:hw******** ***********@nwr dny03.gnilink.n et...
<snip>
<tr>
<FORM NAME='frmOrder3 9ea'>

<snip>

Valid HTML 4 requires (by official DTD) a form element to have an action
attribute and forms may not be children of TR elements. Without starting
with valid HTML there is no reason to expect javascript to be able to
interact successfully with the resulting DOM.

Richard.

Jul 20 '05 #3
> 2) I can't have a form(s) in a table? Do you mean I should use CSS?

Thanks for the info. Could you supply some ideas about what I should change
the code to?


I believe the poster is saying that you need to construct a proper table:

Data is in <td> tags not <tr> tags. Try:

<tr>
<td width='50' valign='middle' align='center'>
<FORM NAME='frmOrder3 9ea'>
....
<form>
</td>
</tr>

I not sure how reliable the font tag is across tables.

Robert
Jul 20 '05 #4
AC
I updated the pages to be HTML 4 compliant as far as I know it did nothing
to help.

Reposting this with the new compliant code and hoping someone can solve
this.

-AC

"Robert" <rc*******@my-deja.com> wrote in message
news:c6******** *************** ***@posting.goo gle.com...
2) I can't have a form(s) in a table? Do you mean I should use CSS?

Thanks for the info. Could you supply some ideas about what I should change the code to?


I believe the poster is saying that you need to construct a proper table:

Data is in <td> tags not <tr> tags. Try:

<tr>
<td width='50' valign='middle' align='center'>
<FORM NAME='frmOrder3 9ea'>
...
<form>
</td>
</tr>

I not sure how reliable the font tag is across tables.

Robert

Jul 20 '05 #5
> =============== =============== ======
<tr>
<FORM NAME='frmOrder3 9ea'>
<td width='50' valign='middle' align='center'> <font size=-1>
<input type='text' size='3' name='QUANTITY' value='0'
onChange='this. value=CKquantit y(this.value)'> </input>&nbsp;</font></td>
</FORM>

<FORM NAME='frmOrder3 9bx'>
<td width='53' valign='middle' align='center'> <font size=-1>
<input type='text' size='3' name='QUANTITY'
value='0'></input>&nbsp;</font></td>
</FORM>
<FORM NAME='frmSubmit Me39'>
<td>
<input type="button" value="Buy"
onClick="Proces sBuys(document. forms['frmOrder39ea'],
document.forms['frmOrder39bx'])">
</td>
</FORM>
</tr>


I hadn't look at this carefully before but you realize that you have
three forms here?

Each form requires an action tag that I do not see. I assume that
each form requires a button. I assume the three forms should be one.

I suggest reviewing the html input source. Find an expert on HTML.

You may want to take a look at:
http://tidy.sourceforge.net/

Robert
Jul 20 '05 #6
AC
"Robert" <rc*******@my-deja.com> wrote in message
news:c6******** *************** ***@posting.goo gle.com...
=============== =============== ======
<snip/>
I hadn't look at this carefully before but you realize that you have
three forms here?

Each form requires an action tag that I do not see. I assume that
each form requires a button. I assume the three forms should be one.

I suggest reviewing the html input source. Find an expert on HTML.

You may want to take a look at:
http://tidy.sourceforge.net/

Robert


Thank you for your replies.

Yes I know. I am using an application called NOPcart v4.2.2
(http://www.nopdesign.com/freecart) for the base and then I modified it a
bit. So I really have 3 forms per product. Which means up to about 150
forms per page :)

I have created a new post "value is null or not an object -- after
submitting a few times" with the cleaned up code. I didn't think this
thread would get any more attention :(

I will look at Tidy.

Thanks,
-AC
Jul 20 '05 #7

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

Similar topics

15
12783
by: Robert Mark Bram | last post by:
Hi All! I have the following code in an asp page whose language tag is: <%@LANGUAGE="JAVASCRIPT" CODEPAGE="65001"%> // Find request variables. var edition = Request.Form ("edition"); var language = Request.Form ("language"); Response.Write("Edition is type &quot;" + (typeof edition) + "&quot; and value &quot;" + edition + "&quot;<br>");
8
2031
by: AC | last post by:
I hope someone can tell me why this is not working. I have a form that dynamically creates the code below. This is for one product and there are about 10 to 50 products that are listed depending on what manufacturer the user selects. After "buying" a few products (4-8) they user gets the error message: 'QUANTITY.value' is null or not an object. Do you see a workaround/fix for this? I posted this on February 19, 2004 under the title...
21
3988
by: Michael Bierman | last post by:
Please forgive the simplicy of this question. I have the following code which attempts to determine the color of some text and set other text to match that color. It works fine in Firefox, but does nothing in IE. I'd be greatful for any assistance. Also, if I will have problems the code on Opera or Safari, I'd appreciate any pointers--I don't have a Mac to test Safari. THanks very much, Michael
5
1885
by: cmc_dermo | last post by:
I have a form that has a select list. A user chooses a value and the page refreshes showing the selected value in the dropdown box. So I want to use Javascript to get the selected query from the form. I then want to pass it as a hidden field. So for example the section of the page I'm interested in will look like
16
25419
by: sneill | last post by:
How is it possible to take the value of a variable (in this case, MODE_CREATE, MODE_UPDATE, etc) and use that as an object property name? In the following example I want 'oIcon' object to have the properties: mode1, mode2, and mode3. This seems simple but I can't quite figure it out... Any ideas anyone?
4
5421
by: John Vottero | last post by:
When a class contains a TimeSpan property, XmlSerializer doesn't work. A TimeSpan property is serialized like: <MySpan /> I've read a number of posts that talk about why this happens and how to work around it. My question is from a slightly different angle. What can I do to my value type structures so that XmlSerializer can serialize them properly?
6
2173
by: David N | last post by:
Hi All, What is a best way to handle an undefined value object class that returned from a function. I have a function that call the ADO.NET ExecuteScalar() function and returns the object to the calling function as follow: public object FunctionA() { object RetVal;
5
1502
by: Jake G | last post by:
I have a flash word verification doohickey running on a page that submits an email (problem with a spammer). The code for the flash is...... <td width="109"<div id="flashcontent"> <object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" codebase="http://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,0,0" width="80" height="40" id="accesscode" align="middle"> <param name="allowScriptAccess"...
275
12365
by: Astley Le Jasper | last post by:
Sorry for the numpty question ... How do you find the reference name of an object? So if i have this bob = modulename.objectname() how do i find that the name is 'bob'
0
9487
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9904
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
0
9735
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 protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
1
7285
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 presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6556
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 then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5168
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
5324
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
3828
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 we have to send another system
3
2697
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.