Wrox Programmer Forums
| Search | Today's Posts | Mark Forums Read
Classic ASP Basics For beginner programmers starting with "classic" ASP 3, pre-".NET." NOT for ASP.NET 1.0, 1.1, or 2.0
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Classic ASP Basics 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
 
Old July 4th, 2005, 05:58 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 null or not an object

I keep getting the error 'value' is null or not an object.

Why is this?

I can get this alert to popup
Code:
alert("checkChdBirthday");
but then get the error

Code:
<script language="javascript">
///////////////////////////////
// Check the CHILD Birthday     //
// 12 Year Old Check         //
///////////////////////////////

function checkChdBirthday(obj)
{
 alert("checkChdBirthday");
    if( !/^(\d{1,2})(\d{1,2})(\d{4})$/.test(obj.value) ) {
        alert( "Invalid date supplied - must be format DDMMYYYY" );
        return;
    }

    var d = new Date();
    var d2 = new Date(RegExp.$3, RegExp.$2, RegExp.$1);

    var diff = d.getDiff(d2, "y")
    alert (diff);
    if( isNaN(diff) ) {
        alert( "Invalid date supplied" );
    }
    else if( diff < 12 ) {
        alert( "This IS an CHILD \n they are younger that 12" );
        child = true;
        submit_form=true;

    }
    else if( diff > 12 ) {
        alert( "This is NOT an CHILD \n they are older that 12" );
        child = false;

        alert(document.form.nochd.value);
        for (i=1; i<document.form.nochd.value; i++)
        {
            document.form.chdbirthday[i].value = "";
            document.form.chddate[i].focus();        
            submit_form=false;
        }
    }        
}
</script>

<% 
noc = 2
for j=1 to noc 
%>


<select name="chddate<%=j%>"
onChange="document.form.chdbirthday<%=j%>.value=document.form.chdbirthday<%=j%>.value+document.form.chddate<%=j%>.options[document.form.chddate<%=j%>.selectedIndex].value;"
style="color: black; font: 7pt Verdana, Arial, Helvetica, sans-serif;">
<%
    Response.write "<option> --- </option>"
For d = 1 to 31
    Response.write "<option value=" & d & ">" & d & "</option>"
Next
%>
</select>
<select name="chdmonth<%=j%>"
onChange="document.form.chdbirthday<%=j%>.value=document.form.chdbirthday<%=j%>.value+document.form.chdmonth<%=j%>.options[document.form.chdmonth<%=j%>.selectedIndex].value;"
style="color: black; font: 7pt Verdana, Arial, Helvetica, sans-serif;">
<%
    Response.write "<option> --- </option>"
For m = 1 to 12
    response.Write "<option value=" & m & ">" & MMtoMMM(m) & "</option>"
Next
%>        
</select>
<% 
Dim vor_15_jahren 
vor_15_jahren = year(date) - 15
%>
<select name="chdyear<%=j%>"
onChange="document.form.chdbirthday<%=j%>.value=document.form.chdbirthday<%=j%>.value+document.form.chdyear<%=j%>.options[document.form.chdyear<%=j%>.selectedIndex].value;"
style="color: black; font: 7pt Verdana, Arial, Helvetica, sans-serif;">
<%
    Response.write "<option> --- </option>"
For y = vor_15_jahren to year(date)
    Response.Write "<option value=" & y & ">" & y & "</option>"
Next
%>
</select>



<input type="text" name="chdbirthday<%=j%>" size="5" style="font:7pt;" maxLength="10"> 


<% next %>

<img src="images/confirm.gif" 
onclick="javascript: checkChdBirthday(document.form.chdbirthday); confirmedok();">
www.crmpicco.co.uk
www.crmpicco.co.uk.tt
www.milklemonadechocolate.uk.tt
www.griswolds.uk.tt
www.piccosmini.co.uk.tt
www.morton.uk.tt
__________________
_______________________
Ayrshire Minis - a Mini E-Community
http://www.ayrshireminis.com
http://www.crmpicco.co.uk




Similar Threads
Thread Thread Starter Forum Replies Last Post
'style' is null or not an object earhear Beginning PHP 0 December 4th, 2007 04:22 AM
null or not a object crmpicco Javascript How-To 5 March 22nd, 2005 10:48 AM
is null or not an object fosterjim Javascript How-To 1 January 24th, 2005 02:11 PM
document null or not an object Adam H-W Javascript 2 April 22nd, 2004 05:59 AM





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