This is Interesting: Free Magazines for Graphics designers and webmasters  


Home > Archive > Stylesheets > December 2005 > input size





You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

Author input size
NEWS

2005-12-21, 6:46 pm

I would like to dynamically change an image boxs size using CSS

<script type="text/javascript">
document.forms[x].elements[y].className="fontSIZED";
document.forms[x]elements[y].size="20";//want to change text box
</script>

The fiirst line works but the second line does not what am I doing wrong??


Jim Moe

2005-12-22, 3:31 am

NEWS wrote:
>
> <script type="text/javascript">
> document.forms[x].elements[y].className="fontSIZED";
> document.forms[x]elements[y].size="20";//want to change text box
> </script>
>
> The fiirst line works but the second line does not what am I doing wrong??
>

Change "forms[x]elements[y]" to "forms[x].elements[y]".

--
jmm (hyphen) list (at) sohnen-moe (dot) com
(Remove .AXSPAMGN for email)
Johannes Koch

2005-12-22, 6:49 am

> NEWS wrote:

Jim Moe wrote:[color=darkred]
> Change "forms[x]elements[y]" to "forms[x].elements[y]".


And according to
<http://www.w3.org/TR/2003/REC-DOM-L...html#ID-6043025>:

attribute unsigned long size;

it must be

forms[x].elements[y].size=20; // no String (no quotes around the value)
--
Johannes Koch
In te domine speravi; non confundar in aeternum.
(Te Deum, 4th cent.)
Jasen Betts

2005-12-22, 6:49 am

On 2005-12-21, NEWS <antispam@nospam.com> wrote:

><script type="text/javascript">
> document.forms[x].elements[y].className="fontSIZED";
> document.forms[x]elements[y].size="20";//want to change text box
></script>

/\
||

shouldn't there be a . betweeen forms[x] and elements[y]

Bye.
Jasen
NEWS

2005-12-22, 7:01 pm


"Johannes Koch" <koch@w3development.de> wrote in message
news:43aa6b16$0$81039$892e7fe2@authen.yellow.readfreenews.net...
>
> Jim Moe wrote:
>
> And according to
> <http://www.w3.org/TR/2003/REC-DOM-L...html#ID-6043025>:
>
> attribute unsigned long size;
>
> it must be
>
> forms[x].elements[y].size=20; // no String (no quotes around the value)
> --


Yet another syntax error, thanks for pointing this out and have a Merry
Christmas


NEWS

2005-12-22, 7:01 pm


"Jasen Betts" <jasen@free.net.nospam.nz> wrote in message
news:6220.43aa665a.46b05@clunker.homenet...
> On 2005-12-21, NEWS <antispam@nospam.com> wrote:
>
> /\
> ||
>
> shouldn't there be a . betweeen forms[x] and elements[y]
>
> Bye.
> Jasen


You are correct thanks for pointing that out,

Merry Christmas


Alan J. Flavell

2005-12-22, 7:01 pm

On Thu, 22 Dec 2005, NEWS wrote:

> Yet another syntax error, thanks for pointing this out


Please, learn the right lesson from this. It is demeaning to ask
humans to be a syntax checker. All of us make typos at one time or
another: learn to syntax-check your code through appropriate software
*before* appealing for help. Also, if code is to be included in the
posting, be sure to copy/paste (NOT retype) exact code into your
postings - better, though, is to include the URL of your test material
- again, of course, *after* passing it by the relevant validation.

> and have a Merry Christmas


Follow these guidelines, and I'm sure Father X will do the right thing
for you ;-)
Sponsored Links


Copyright 2003 - 2008 forum4designers.com  Software forum  Computer Hardware reviews