Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 9 of 9
  1. #1
    New to the CF scene
    Join Date
    Jun 2003
    Location
    Saudi Arabia
    Posts
    3
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Script not working in Netscape but working in IE

    Please could you have a look at my script and help me out - basically I've re-directed my form to a popup window displaying confirmation that all the fields are correctly filled out - this works absolutely brilliant in IE but the table is not showing up in Netscape - I ran an error check and Netscape came up with the following error: Line 129 - Form1 not Defined.

    I was really hoping I could get this to work in both browsers and I can't see why it shouldn't, problem is I'm not too familiar with javascript.

    I would really appreciate any help or ideas on this - try my script out in IE and see how great it is!!!

    Kind regards
    Nick
    Attached Files Attached Files

  • #2
    Regular Coder
    Join Date
    Jun 2002
    Location
    Flint, Michigan, USA
    Posts
    620
    Thanks
    1
    Thanked 20 Times in 20 Posts
    The reference to 'Form1' is in the popup window, but the definition is in the main window. You need something like 'parent.document.Form1...' in the popup.

  • #3
    New to the CF scene
    Join Date
    Jun 2003
    Location
    Saudi Arabia
    Posts
    3
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Problem solved - thanks to Jalarie!

    Jalarie,

    Thanks ever so much for your help - really do appreciate it - it is now working perfectly in both IE and Netscape!!!

    I can't believe how fussy Netscape can be!!

    Kind regards
    Nick

  • #4
    Regular Coder
    Join Date
    Jun 2002
    Location
    Flint, Michigan, USA
    Posts
    620
    Thanks
    1
    Thanked 20 Times in 20 Posts
    Netscape is forcing you to do it right; IE is allowing you to be sloppy. I design in NS and then check it in other browsers and seldom need any changes.

  • #5
    New to the CF scene
    Join Date
    Jun 2003
    Location
    Saudi Arabia
    Posts
    3
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Netscape and IE

    You are 100% right - thanks for the advice - I'll do this from now on!

    There's another thing I was hoping you might know what I'm doing wrong - I'm trying to capture the date field from the parent window, the fields are:

    FirstSelectDay
    FirstSelectMonth
    FirstSelectYear

    I've tried the following script but it's not working:

    test.document.write('<tr><th align=left> Date:</th><td> ' + parent.document.Form1.FirstSelectDay.selected + '-' + parent.document.Form1.FirstSelectMonth.value + '-' + parent.document.Form1.FirstSelectYear.value + '</td></tr>')

    Both "value" and "selected" or "now" don't work - how would I pull the selected date from the parent window?

    Kind regards
    Nick

  • #6
    Regular Coder
    Join Date
    Jun 2002
    Location
    Flint, Michigan, USA
    Posts
    620
    Thanks
    1
    Thanked 20 Times in 20 Posts
    First pick up the information something like the following lines, and then build your output line:

    FSD_I=parent.document.Form1.FirstSelectDay.selectedIndex;
    FSD_T=parent.document.Form1.FirstSelectDay.options[FSD_I].text;
    FSM_I=parent.document.Form1.FirstSelectMonth.selectedIndex;
    FSM_T=parent.document.Form1.FirstSelectMonth.options[FSM_I].text;
    FSY_I=parent.document.Form1.FirstSelectYear.selectedIndex;
    FSY_T=parent.document.Form1.FirstSelectYear.options[FSY_I].text;


    Actually, I'd probably start with an abbreviation and then do the pickup:

    FSD=parent.document.Form1.FirstSelectDay;
    FSD_I=FSD.selectedIndex;
    FSD_T=FSD.options[FSD_I].text;
    FSM=parent.document.Form1.FirstSelectMonth;
    FSM_I=FSM.selectedIndex;
    FSM_T=FSM.options[FSM_I].text;
    FSY=parent.document.Form1.FirstSelectYear;
    FSY_I=FSY.selectedIndex;
    FSY_T=FSY.options[FSY_I].text;

  • #7
    New Coder
    Join Date
    Jun 2003
    Location
    UK
    Posts
    10
    Thanks
    0
    Thanked 0 Times in 0 Posts

    I too have a similar problem

    My java scripts work in IE but not Netscape. I can however view the scripts in Netscape on their authors' pages, so the problem is not with my Netscape setup, but within my coding.

    Could anyone with the time please look at http://www.the-limes.com in IE and then in Netscape and thern look at the source and see if they can suggest what I have done wrong?

    Many thanks,

    Simon

  • #8
    New Coder
    Join Date
    Jun 2003
    Location
    UK
    Posts
    10
    Thanks
    0
    Thanked 0 Times in 0 Posts

    I too have a similar problem....continued

    I have just noticed that some Java scripts ARE working in Neyscape on my website. The ones that are not working are the ones which should produce stuff in the left hand margin of the page, the rest of the page being to the right of the 18% margin. I don't know if this will help someone sort me out?!

    Simon

  • #9
    Regular Coder
    Join Date
    Jun 2002
    Location
    Flint, Michigan, USA
    Posts
    620
    Thanks
    1
    Thanked 20 Times in 20 Posts
    simongdawson, Netscape gives the following error messages:

    JavaScript Error:
    http://www.the-limes.com/java/menu_array.js, line 21:

    missing ; before statement.

    menunum=0;menus=new Array();_d=document;function addmenu(){menunum++;menus[menunum]=menu;}function dumpmenus(){mt="<scr"+"ipt language=JavaScript>";for(a=1;a<menus.length;a++){mt+=" menu"+a+"=menus["+a+"];"}mt+="<\/scr"+"ipt>";_d.write(mt)}
    ..........................................................................................^

    JavaScript Error:
    http://www.the-limes.com/java/menu_array_2.js, line 79:

    dumpmenus is not defined.


    The second error message is caused by the first. I think that the problem in the first is that Netscape does not recognize the '_d=document;' as valid.


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •