Wrox Programmer Forums
Go Back   Wrox Programmer Forums > Web Programming > JavaScript > Javascript
|
Javascript General Javascript discussions.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Javascript 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 21st, 2006, 05:07 PM
Friend of Wrox
 
Join Date: Jun 2005
Posts: 244
Thanks: 3
Thanked 4 Times in 4 Posts
Default .js outside script problems

hi all,

the code below has an error message and it says that the code in bold is null or not an object, now this code is within a .js file and calls those variables from a html page outside of the .js file:

var firstname = document.recruit.firstname.value;
var age = document.recruit.age.value;
var timeplayingcss = document.recruit.timecss.value;
function validateform(){
    if (firstname == "" || firstname == null && age <= "18" ||age == "" || age == null && timeplayingcss == "" || timeplayingcss == null) {
        alert("Excuse me " + document.recruit.firstname.value + " but you've left a few fields blank");
    }
    else
    {
    window.close();
    window.open("validated.html","","width=200,height= 200");
    }
}

function close_bringup(){
    var name = document.recruit.firstname.value;
    window.close;
    window.open("index2.html");
}

thanks to anyone who can help
__________________
Apocolypse2005, I'm a programmer - of sorts.
 
Old July 25th, 2006, 07:33 PM
Friend of Wrox
 
Join Date: Jan 2006
Posts: 198
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Do you have a form on your page with the name "recruit"? E.g. <form name="recruit" ... > ?

Jon Emerson
http://www.jonemerson.net/





Similar Threads
Thread Thread Starter Forum Replies Last Post
File Uploading Script Problems mercury7 BOOK: Beginning PHP4/PHP 5 ISBN: 978-0-7645-4364-7; v5 ISBN: 978-0-7645-5783-5 13 January 8th, 2009 09:13 AM
Script Debugging Problems calcott VBScript 1 August 16th, 2008 02:04 AM
GoDaddy script install problems robhmac Perl 3 October 24th, 2006 07:39 AM
JS Script help... Thomas82 Classic ASP Basics 2 April 29th, 2005 05:16 AM
Repeat use of a js script fails John K. King Javascript 1 May 19th, 2004 02:56 PM





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