[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Need help



At 11:36 12/02/96 -0600, you wrote:
>I am trying to run the following script and most of the time the Netscape
>produce an access violation error in my NT workstation. I do not know
>whether this a problem in my script or bug in Netscape. If any of you can
>help me I would appreciate it a lot.
>

Hello, 

When strings are used, you must alternate the use of " and '


This is the corrected version, which run without errors using Windows 3.1
and Netscape 2.0 final:

Gook luck.

......................
<html>
<head>
<script language="JavaScript">

function validate(winobj)
{
    form_obj = winobj.document.date_form;
    yr_s = form_obj.elements[0];
    month_s = form_obj.elements[1];
    day_s = form_obj.elements[2];

    yr = yr_s.options[yr_s.selectedIndex].text;
    month = month_s.options[month_s.selectedIndex].text;
    day = day_s.options[day_s.selectedIndex].text;

    winobj.document.clear();
    winobj.document.close();
    winobj.close();

    { stat_date = yr+'-'+month+'-'+day; 
      window.document.write('<B> You have requested stats for
"+stat_date+"</B></P>');
      
    }
    
}


function date_entry_proc(msg)
{   

    date_entry_win = window.open("","data_entry_window",
       "toolbar=0,menubar=0,directories=0,width=400,height=200");
    date_entry_win.CreatorWindow = window;

    date_entry_win.document.open();
    date_entry_win.document.writeln("<HTML>");
    date_entry_win.document.writeln('<CENTER><FONT
SIZE=+2>"+msg+"</FONT></CENTER>');
    date_entry_win.document.writeln("<HR><FORM NAME='date_form'>");
    date_entry_win.document.writeln("Year <SELECT NAME ='yr'>"+ 
        "<OPTION SELECTED> 1996 <OPTION> 1995</SELECT>"+
        "  Month <SELECT NAME = 'month'>"+
        "<OPTION SELECTED> 1 <OPTION>2<OPTION>3<OPTION>4<OPTION>5<OPTION>6"+
        "<OPTION>7<OPTION>8<OPTION>9<OPTION>10<OPTION>11<OPTION>12</SELECT>"+
        "  Day <SELECT NAME = 'day'>"+
        "<OPTION SELECTED> 0 <OPTION>1<OPTION>2<OPTION>3"+
        "<OPTION>4<OPTION>5<OPTION>6<OPTION>7<OPTION>8<OPTION>9"+     
        "<OPTION>10<OPTION>11<OPTION>12<OPTION>13<OPTION>14<OPTION>15"+
	"<OPTION>16<OPTION>17<OPTION>18<OPTION>19<OPTION>20<OPTION>21"+
	"<OPTION>22<OPTION>23<OPTION>24<OPTION>25<OPTION>26<OPTION>27"+
	"<OPTION>28<OPTION>29<OPTION>30<OPTION>31</SELECT>");

    date_entry_win.document.writeln("<P><CENTER> <INPUT TYPE='button'
VALUE='OK'"+
        'onClick=CreatorWindow.document.validate(window)></CENTER> ');
   
    date_entry_win.document.writeln("</FORM></HTML>");
}



</script>


</head>
<title> java script test </title>
<table>
<tr>
<td> <img src="dclogo.gif"></td>
<td><font size=+2><center>Data Communications Gateway Statistics Display 
Page</center>
     </font></td>
</tr>
</table> 

<body>
<FORM NAME = "select_form">

<FONT SIZE+=1><B>Selected day<B></FONT>
    <INPUT TYPE="button" NAME=yest_stats VALUE="Select date"
           onClick="date_entry_proc('Select Date')"><P>
<P>
</FORM>
</body>
</html>
......................

--
Lourdes Yero
E-mail: lyero@dino.conicit.ve