Wrox Programmer Forums
Go Back   Wrox Programmer Forums > Web Programming > JavaScript > Javascript How-To
| Search | Today's Posts | Mark Forums Read
Javascript How-To Ask your "How do I do this with Javascript?" questions here.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Javascript How-To section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
  #1 (permalink)  
Old May 8th, 2007, 11:04 AM
Friend of Wrox
Points: 8,019, Level: 38
Points: 8,019, Level: 38 Points: 8,019, Level: 38 Points: 8,019, Level: 38
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Jan 2005
Location: Mauchline, East Ayrshire, Scotland
Posts: 1,525
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via ICQ to crmpicco Send a message via AIM to crmpicco Send a message via MSN to crmpicco Send a message via Yahoo to crmpicco
Default javascript calendar won't appear unless HTML = out

Code:
<html>
<head>
<meta http-equiv="Content-Language" content="en-gb">
<meta http-equiv="Content-Type" content="text/html; charset=windows-1252">
<title>PiccoNet</title>
</head>
<body>

<table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
    <td valign="top">
        <div class="pageheader">
            <div class="pageheaderleft">
                <h1>Administration</h1>
                <div id="tabs">
                    [list]
                        <li><a href="/system/adm2.pl" title="Main Menu">Main Menu</a></li>
                        <li class="here"><a href="?action=findc" title="C">C</a></li>
                        <li><a href="?action=find" title="I">I</a></li>
                        <li><a href="?action=showc" title="Groups">Groups</a></li>
                        <li><a href="?action=special" title="Specials">Specials</a></li>
                        <li><a href="?action=pricec" title="Price C">Price C</a></li>
                        <li><a href="?action=upload" title="Image">Image</a></li>
                    </ul>
                </div>
            </div>
<!--
WORKS WHEN THIS IS OUT?!??
            <div class="pageheaderright">
                <form method="GET" action="/system/ch.pl">
                    Page #<input type="text" name="page" value="978" size="5">
                    <input type="submit" value="Go">
                </form>
            </div>
-->
        </div>

            <p class="bread"><img src="/images/breadarrow.gif" width="14" height="9" alt="&gt;"><a href="/system/adm2.pl">Main</a></p>

            <script language="JavaScript" src="CalendarPopup.js"></script>

            <script language="JavaScript">
            var now = new Date();
            var cal = new CalendarPopup("calendar");
            cal.addDisabledDates(null, formatDate(now, "yyyy-MM-dd"));
            cal.offsetX = 90;
            cal.offsetY = 20;
            document.write(getCalendarStyles());
            </script>        


        <div id="calendar" style="position:absolute; visibility:hidden; background-color:white; layer-background-color:white;"></div>

        <h2 style="margin-bottom: 0">Balance Calculator</h2>

        <div class="formback">
            <form style="margin: 0;">
            <table cellspacing="2" cellpadding="2" class="formtable"><tr>
                <td class="formlabel">Start Date&nbsp;<span class="formrequired">*</span></td>

                <td class="formfield"><input type="text" name="date" id="date" value="dd/mm/yyyy" tabindex="3" style="width: 180px;" autocomplete="off" onclick="cal.select(document.forms[0].date,'date','dd/MM/yyyy'); return false;" onfocus="cal.select(document.forms[0].date,'date','dd/MM/yyyy'); return false;"></td>
            </tr><tr>
                <td class="formlabel">&nbsp;</td>
                <td class="formfield"></td>
            </tr>
            </table>
            </form>
        </div>
    </td>
</tr>
</table>
</body>
</html>
Any idea why, with this code the js pop-up won't appear unless the code that i have commented out is commented out?
Help appreciated.
Picco

www.crmpicco.co.uk
www.ie7.com
__________________
_______________________
Ayrshire Minis - a Mini E-Community
http://www.ayrshireminis.com
http://www.crmpicco.co.uk
  #2 (permalink)  
Old May 9th, 2007, 05:48 AM
Friend of Wrox
Points: 8,019, Level: 38
Points: 8,019, Level: 38 Points: 8,019, Level: 38 Points: 8,019, Level: 38
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Jan 2005
Location: Mauchline, East Ayrshire, Scotland
Posts: 1,525
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via ICQ to crmpicco Send a message via AIM to crmpicco Send a message via MSN to crmpicco Send a message via Yahoo to crmpicco
Default

turned out it was the
Code:
document.forms[0].date
call on my onclick. I used forms[0] instead of forms[1]. I know it's old school code anyway now, need to get it changed to document.getElementById.

Picco

www.crmpicco.co.uk
www.ie7.com


Similar Threads
Thread Thread Starter Forum Replies Last Post
Passing Parameters in html/javascript js_newbie Javascript 2 February 17th, 2007 08:44 PM
doubt in JSP, Javascript,HTML vidhya_mscinfo Other Programming Languages 0 May 3rd, 2006 10:19 AM
Read HTML comments with Javascript benburrows Javascript How-To 3 October 29th, 2004 12:50 PM
Javascript to HTML Special Characters gilf Javascript 6 May 19th, 2004 09:25 AM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.