![]() | |
![]() |
| | Thread Tools | Display Modes |
#1
| |||
| |||
|
#2
| ||||
| ||||
|
|
Hi, I have a simple form which uses the following code to add lines into a textarea field from a button The problem is that it always seems to begin on the 3rd line, i.e. skips line 1 & 2 in the textarea box |
|
I would like it to start at line 1, how can I adjust the code to do this ? ----------------------------------------- SCRIPT language="JavaScript" |
|
!-- |
|
document.formname.quantity.value Do you really have a form called "formname"? Each to his own I suppose |
#3
| |||
| |||
|
|
Hi, I have a simple form which uses the following code to add lines into a textarea field from a button The problem is that it always seems to begin on the 3rd line, i.e. skips line 1 & 2 in the textarea box I would like it to start at line 1, how can I adjust the code to do this ? ----------------------------------------- SCRIPT language="JavaScript" !-- function addItem(){ var Unit = document.schedule.schedule_update.value if (Unit=='') {Unit += document.formname.quantity.value + " x " +document.formname.list2.value} else {Unit += '\n' + document.formname.quantity.value + " x " + document.formname.list2.value} document.schedule.schedule_update.value = Unit } //-- /SCRIPT |
#4
| |||
| |||
|
|
On Sep 25, 11:16 am, David <davidgor... (AT) scene-double (DOT) co.uk> wrote: SCRIPT language="JavaScript" Use <script type="text\javascript" |
|
document.formname.quantity.value Do you really have a form called "formname"? Each to his own I suppose |
#5
| |||
| |||
|
|
news (AT) chthonic (DOT) f9.co.uk wrote: On Sep 25, 11:16 am, David <davidgor... (AT) scene-double (DOT) co.uk> wrote: SCRIPT language="JavaScript" Use <script type="text\javascript" Correct is |
|
script type="text/javascript" (This is the Internet, not Micro$~1 Windows.) document.formname.quantity.value Do you really have a form called "formname"? Each to his own I suppose The above should read document.forms["formname"].elements["quantity"].value to be both standards compliant and backwards compatible. |
#6
| |||
| |||
|
|
Thomas 'PointedEars' Lahn said the following on 9/25/2007 12:49 PM: news (AT) chthonic (DOT) f9.co.uk wrote: On Sep 25, 11:16 am, David <davidgor... (AT) scene-double (DOT) co.uk> wrote: SCRIPT language="JavaScript" Use <script type="text\javascript" Correct is According to the W3C Validator, it is. |
|
According to any standards that define MIME Types for the script element it isn't correct. |
|
document.formname.quantity.value Do you really have a form called "formname"? Each to his own I suppose The above should read document.forms["formname"].elements["quantity"].value to be both standards compliant and backwards compatible. Nonsense. |
#7
| |||
| |||
|
|
Randy Webb wrote: Thomas 'PointedEars' Lahn said the following on 9/25/2007 12:49 PM: news (AT) chthonic (DOT) f9.co.uk wrote: On Sep 25, 11:16 am, David <davidgor... (AT) scene-double (DOT) co.uk> wrote: SCRIPT language="JavaScript" Use <script type="text\javascript" Correct is According to the W3C Validator, it is. The W3C Validator uses an SGML or XML parser that can only validate a document resource against a DTD, and the (X)HTML (4.01/1.x) DTDs only specify the attribute value to be CDATA (which is fulfilled here): |
|
According to any standards that define MIME Types for the script element it isn't correct. Exactly. |
|
document.formname.quantity.value Do you really have a form called "formname"? Each to his own I suppose The above should read document.forms["formname"].elements["quantity"].value to be both standards compliant and backwards compatible. Nonsense. It is _not_ nonsense. (As you should know already,) W3C DOM Level 2 HTML also specifies the ECMAScript binding for the interfaces defined there: http://www.w3.org/TR/DOM-Level-2-HTM...t-binding.html |
#8
| |||
| |||
|
|
n... (AT) chthonic (DOT) f9.co.uk wrote: On Sep 25, 11:16 am, David <davidgor... (AT) scene-double (DOT) co.uk> wrote: SCRIPT language="JavaScript" Use <script type="text\javascript" Correct is script type="text/javascript" (This is the Internet, not Micro$~1 Windows.) |
#9
| |||
| |||
|
|
The *only* time bracket notation is preferred over dot notation is if the identifier has certain characters in it. It has nothing to do with "standards compliant" and it sure as Hades has nothing to do with "backwards compatibility". |
#10
| ||||||||
| ||||||||
|
|
Thomas 'PointedEars' Lahn said the following on 9/25/2007 1:48 PM: Randy Webb wrote: Thomas 'PointedEars' Lahn said the following on 9/25/2007 12:49 PM: news (AT) chthonic (DOT) f9.co.uk wrote: On Sep 25, 11:16 am, David <davidgor... (AT) scene-double (DOT) co.uk> wrote: SCRIPT language="JavaScript" Use <script type="text\javascript" Correct is According to the W3C Validator, it is. The W3C Validator uses an SGML or XML parser that can only validate a document resource against a DTD, and the (X)HTML (4.01/1.x) DTDs only specify the attribute value to be CDATA (which is fulfilled here): snipped lots of URL's I don't care about |
|
I was referring to your supposition that the only acceptable script element was with a type attribute that, as you know, has no defined/standardized MIME types for it. |
|
The only one acceptable is "text/javascript" |
|
and, unless you name your phantom UA, the only thing that complains about it is the W3C Validator. |
|
According to any standards that define MIME Types for the script element it isn't correct. Exactly. And that "Exactly" is because, as you are well aware, there are *no* *defined* MIME types for the type attribute for a script element. |
|
document.formname.quantity.value Do you really have a form called "formname"? Each to his own I suppose The above should read document.forms["formname"].elements["quantity"].value to be both standards compliant and backwards compatible. Nonsense. It is _not_ nonsense. (As you should know already,) W3C DOM Level 2 HTML also specifies the ECMAScript binding for the interfaces defined there: http://www.w3.org/TR/DOM-Level-2-HTM...t-binding.html And as you should know already, I won't repeat my opinion of a bunch of useless worthless text on a webpage. |
|
The *only* time bracket notation is preferred over dot notation is if the identifier has certain characters in it. It has nothing to do with "standards compliant" |
|
and it sure as Hades has nothing to do with "backwards compatibility". |
![]() |
| Thread Tools | |
| Display Modes | |
| |