473,396 Members | 1,849 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,396 software developers and data experts.

Error with the characters - or.

Hello with all

I have a problem with a javascript function and I can't
find the solution. When I put in my SQL table in the field
'artno' a character like "-" or a "." I get the following
error message: missing ')'

See function AddArt()

Sample: Article number like 'TL0012' OK
Article number like 'TL-11.12' essor!

Thank you in advance for all informations.

Otto
in php...
// Show the fiels on the same line
echo $clinec.$row[2]."</td>"; // Groupe
echo $clinec.$row[3]."</td>"; // No d'article
echo $clinec.$row[4]."</td>"; // désignation
echo $clinec.$row[6]."</td>"; // prix

?>
<TD><INPUT TYPE="value" NAME="pos<?= $row[3]?>quant"
VALUE="1" SIZE=3>
<INPUT NAME="pos<?= $row[3]?>number" TYPE=Hidden VALUE="<?=
$row[3]?>">

<INPUT TYPE="button" VALUE="<?= $txt_add ?>"
onclick="AddArt('<?= $row[4] ?>', '<?= $row[6] ?>',
document.itemsform.pos<?= $row[3] ?>quant.value,
document.itemsform.pos<?= $row[3]
?>number.value)\"></TD></TR>
<?php

Jul 23 '05 #1
4 1155
On Fri, 02 Apr 2004 13:20:17 +0200, l'atelier Ho <at***@freesurf.ch> wrote:
I have a problem with a javascript function and I can't
find the solution. When I put in my SQL table in the field
'artno' a character like "-" or a "." I get the following
error message: missing ')'


AddArt(
'<Name>',
'<Price>',
document.itemsform.pos<articleNum>quant.value,
document.itemsform.pos<articleNum>number.value );

This would be function call, without the angle brackets and the fields
replaced as appropriate, yes? Well, consider what would happen if you were
to insert a hyphen (-) or dot (.):

document.itemsform.posTL-11quant.value

or

document.itemsform.posPR.89quant.value

The former would be treated as a subtraction. The latter would treat the
article number section as two separate properties.

As such, both fall under the same subject as this FAQ entry:

<URL:http://jibbering.com/faq/#FAQ4_25>

That would result in:

document.itemsform.elements[ 'posTL-11quant' ].value

and

document.itemsform.elements[ 'posPR.89quant '].value

Mike

--
Michael Winter
M.******@blueyonder.co.invalid (replace ".invalid" with ".uk" to reply)
Jul 23 '05 #2
Hello Mike

Many thanks four your quick answer. If I understand you correctly I should
add angle brackets. I did it and I get actually the following html source
code:

Onclick="AddArt('Biscuits', '1.00', document.itemsform.pos<NV-123.22
23>.value, document.itemsform.pos<NV-123.22 23>.value)"

The trouble, I still get the same error message.

I changed my php line to the following (I added brackets before and after
$row[3] ):

echo "<INPUT TYPE=\"button\" VALUE=\"$txt_add\" onclick=\"AddArtF('$row[4]',
'$row[6]', document.itemsform.pos<$row[3]>.value,
document.itemsform.pos<$row[3]>.value)\"></TD></TR>";
Best regards

Otto

Newsgroups: comp.lang.javascript
Subject: Re: Error with the characters - or.
From: Michael Winter <M.******@blueyonder.co.invalid>
Date: Fri, 02 Apr 2004 11:57:39 GMT

On Fri, 02 Apr 2004 13:20:17 +0200, l'atelier Ho <at***@freesurf.ch> wrote:
I have a problem with a javascript function and I can't
find the solution. When I put in my SQL table in the field
'artno' a character like "-" or a "." I get the following
error message: missing ')'


AddArt(
'<Name>',
'<Price>',
document.itemsform.pos<articleNum>quant.value,
document.itemsform.pos<articleNum>number.value );

This would be function call, without the angle brackets and the fields
replaced as appropriate, yes? Well, consider what would happen if you were
to insert a hyphen (-) or dot (.):

document.itemsform.posTL-11quant.value

or

document.itemsform.posPR.89quant.value

The former would be treated as a subtraction. The latter would treat the
article number section as two separate properties.

As such, both fall under the same subject as this FAQ entry:

http://jibbering.com/faq/#FAQ4_25

That would result in:

document.itemsform.elements[ 'posTL-11quant' ].value

and

document.itemsform.elements[ 'posPR.89quant '].value

Mike

--
Michael Winter
M.******@blueyonder.co.invalid (replace ".invalid" with ".uk" to reply)

Jul 23 '05 #3
On Sun, 04 Apr 2004 12:53:30 +0200, l'atelier Ho <at***@freesurf.ch> wrote:

[fixed top-post]
Many thanks four your quick answer. If I understand you correctly I
should add angle brackets. I did it and I get actually the following
html source code:

Onclick="AddArt('Biscuits', '1.00', document.itemsform.pos<NV-123.22
23>.value, document.itemsform.pos<NV-123.22 23>.value)"


Sorry, no. You didn't understand me correctly.

The function call with the angle brackets was just to display the format
of your calls better. I did ask below it if the format was correct with
the brackets removed and their contents replaced by a code sequence. I
then proceeded to explain, by doing just that - replacing the angle
brackets, why errors occurred: hyphens are treated as subtraction
operators, and dots are treated as property accessors.

It was the last part of my post, after the URI, that showed how to create
a reference correctly that involved characters that are treated as
operators.

document.itemsform.elements[ 'posTL-11quant' ].value

So, the function call you display above would become:

AddArt(
'Biscuits',
'1.00',
document.itemsform.elements[ 'posNV-123.22 23' ].value,
document.itemsform.elements[ 'posNV-123.22 23' ].value );

I hope that's clearer, and I apologise for the confusion.

Mike

--
Michael Winter
M.******@blueyonder.co.invalid (replace ".invalid" with ".uk" to reply)
Jul 23 '05 #4
Hello Mike

php
document.itemsform.elements['pos$row[3]quant'].value

I did the following and now it work very well. Many thanks for
your help. Hope you still have time to relax on this sunday.

I hope that's clearer, and I apologise for the confusion.
I'm also a little bit confuse. My english is not so good.
Best regards

Otto
Switzerland
Document.itemsform.elements[ 'posTL-11quant' ].value

So, the function call you display above would become:

AddArt(
'Biscuits',
'1.00',
document.itemsform.elements[ 'posNV-123.22 23' ].value,
document.itemsform.elements[ 'posNV-123.22 23' ].value );

I hope that's clearer, and I apologise for the confusion.

Jul 23 '05 #5

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

Similar topics

3
by: josh dismukes | last post by:
/// here is the code i'm getting a parse error on the last line of the code which /// is </html> any help will be much appreciated. <?php session_start ();
1
by: Sean Abrahams | last post by:
The following is a reprint of a message I sent to the tutor list a long time ago, that I haven't gotten around to discussing with anyone else and failed to hear a reply on the tutor list. Hoping...
4
by: muser | last post by:
Can anyone run this program through their compiler or if they can see a logical error please point it out. I have my tutor working on it at the moment but I would rather a less ambigious response...
11
by: muser | last post by:
In the code I supplied before this one, the cause of the problem is an access violation error. When I run the debugger it skips into what I can only assume is the compilers version of my code. And...
1
by: Chief | last post by:
I am unable to load an xml document that contains Chinese characters in an attribute value. I need to load the document into and XmlDocument object and am using the XmlDocument.Load(string...
6
by: Peter Frost | last post by:
Please help I don't know if this is possible but what I would really like to do is to use On Error Goto to capture the code that is being executed when an error occurs. Any help would be much...
9
by: sparks | last post by:
I have a table in 2003 that has 221 fields defined. I tried to add another variable and got this error. I was surprised when it didn't say too many fields defined. I look at the error...
1
by: Alexander Higgins | last post by:
>>Thanks for the response.... Point Taken but this is not the case. Thus, if a person writes a text file on her or his computer and does not use UNICODE to save it, the current code page is...
3
by: Kai Schlamp | last post by:
Hello! In my schema I have the following: <xs:complexType name="textareaType"> <xs:simpleContent> <xs:restriction base="xs:string"> <xs:attribute ref="label" use="required" />...
12
eragon
by: eragon | last post by:
Im trying to put a captcha image in my site to stop people from spamming, and when i view the image its self i get this: Fatal error: Call to undefined function imagettfbbox() in...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
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
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
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
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
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,...

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.