Wrox Programmer Forums

Need to download code?

View our list of code downloads.

Go Back   Wrox Programmer Forums > Web Programming > JavaScript > Javascript How-To
Password Reminder
Register
| FAQ | Members List | Calendar | 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 tens of thousands of software programmers and website developers including Wrox book authors and readers. As a guest, you can read any forum posting. By joining today you can post your own programming questions, respond to other developers’ questions, and eliminate the ads that are displayed to guests. Registration is fast, simple and absolutely free .
DRM-free e-books 300x50
Reply
 
Thread Tools Search this Thread Display Modes
  #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
Reply With Quote
  #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
Reply With Quote
Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off


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



All times are GMT -4. The time now is 05:18 PM.


Powered by vBulletin®
Copyright ©2000 - 2019, Jelsoft Enterprises Ltd.
© 2013 John Wiley & Sons, Inc.