PDA

View Full Version : JavaScript not working


javaspace
02-13-2003, 06:16 PM
Hello:

Can some one tell me what's wrong with the code below. When I click on the image I get an error in line 1.

Thanks for your help in advance.

<html>
<body>
<TITLE> DSC EDI 214 Delivery Interface </TITLE>
<script language="JavaScript" src="ts_picker4x.js"></script><!-- Date only with year scrolling -->
<form name='frmedi214d'>
<input type='Text' name='input7' value='' > <a href='javascript:show_calendar4x('document.frmedi214d.input7', document.frmedi214d.input7.value);'>
<img src='images\cal.gif' width='16' height='16' border='0' alt='Click Here to Pick up the date'></a></input>
</form>
</body>
</html>

Philip M
02-13-2003, 06:56 PM
<!-- Date only with year scrolling -->

needs // to end comment

<!-- Date only with year scrolling //-->

justame
02-13-2003, 06:57 PM
jav...
just a try® putting this line...
<TITLE> DSC EDI 214 Delivery Interface </TITLE>


just a before® this one...
<body>

n' tooo??? you should just a have® the ol' <head> tags in there tooo...

<html>
<head>
<title>yadda</title>
<script language="JavaScript" src="ts_picker4x.js"></script>
</head>
<body>
your contents here...
</body>
</html>

n' for some reason /me just a thinks® thattt the <script language="JavaScript" src="ts_picker4x.js"></script> just a belongs® up where /me put it...:O)))

javaspace
02-13-2003, 07:11 PM
Tried both solutions did not work. When I point to the Image, I see on the status bar only Javascript:show_calendar4x(

It show the rest of the javascript code. I cannot figure out what the problem is?

Thanks

beetle
02-13-2003, 07:41 PM
Ok, what I can see wrong... The <title> belongs in the <head>
<input> has no closing tag
Linked JS files should be in the <head>
Attributes should be delimited by double quotes, not single
Escaping problem with hrefHere's how the code should look with all these errors fixed<html>
<head>
<title> DSC EDI 214 Delivery Interface </title>
<script language="JavaScript" src="ts_picker4x.js"></script><!-- Date only with year scrolling -->
</head>

<body>

<form name="frmedi214d">

<input type="text" name="input7" value="">
<a href="javascript:show_calendar4x('document.frmedi214d.input7', document.frmedi214d.input7.value);">
<img src="images\cal.gif" width="16" height="16" border="0" alt="Click Here to Pick up the date">
</a>

</form>

</body>
</html>However, I doubt that the calendar function, show_calendar4x requires the first parameter as a string...probably should be <a href="javascript:show_calendar4x(document.frmedi214d.input7, document.frmedi214d.input7.value);">