|
Posted by zalek on 11/06/07 03:53
On Nov 5, 10:09 pm, RobG <rg...@iinet.net.au> wrote:
> On Nov 6, 12:22 pm, zalek <zalekbl...@hotmail.com> wrote:
>
> > Here is my site:http://www.geocities.com/zalekbloom/a2.html
>
> The rubbished added by your host inserts scripts that cause errors in
> Firefox, and they make your page invalid HTML.
>
> > When I open this site with FireFox - Select fields "Date from (yyyyy/
> > mm/dd)" and "Date to (yyyyy/mm/dd)" are not initialized, but they are
> > initialized when I open this site with IE.
>
> > The code that is not working in FireFox but working in IE is:
>
> > var option0 = new Option(curr_year,curr_year) ;
> > document.form1.f_from_yyyy.add(option0) ;
>
> You are mixing DOM 0 (new Option) and DOM 1 (add method) and Firefox
> doesn't like it. Instead, use just DOM 0 (wrapped for posting):
>
> var sel = document.form1.f_from_yyyy;
> if (sel) {
> sel.options[sel.options.length] =
> new Option(curr_year, curr_year);
> }
>
> --
> Rob
Thanks Rob,
It worked!
Now another question - I want to display a date on a page.
I used command:
document.write(....)
but after I put this code in function that starts "onLoad" - this code
is not working.
So how to display a date, or other string built by a function?
Thanks,
Zalek
Navigation:
[Reply to this message]
|