Wrox Programmer Forums
|
Other Programming Languages If you have a coding issue to discuss about another language that really isn't provided for in any other forum here (not ASP.NET C#, C++, VB, PHP, JavaScript, Python, Java, Perl, Applescript, XML or any of the other forum topics we have), post it here. Enough discussion on a language we don't have covered could prompt a new forum.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Other Programming Languages 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 April 25th, 2006, 07:15 PM
Authorized User
 
Join Date: Jan 2005
Posts: 42
Thanks: 0
Thanked 0 Times in 0 Posts
Default Validate only if enabled

Validation only if item is eneabled

--------------------------------------------------------------------------------

Need help everyone...

I have a form that is validated by javascript, pretty standard no errors works gret.

I have a file form element that is only enabled, if, one or two items from a select box are chosen...this also works.

The part I am having trouble with is that when the file form element is enabled I want to make sure that it is not left blank.

here is my code so far...


Code:
function validate1() {

var theMessage = "All fields in this form are required. \n"  
theMessage = theMessage + "\n Please complete the following:" 
theMessage = theMessage + "\n-----------------------------------\n";

var noErrors = theMessage


if (document.theForm.ImageUpload.enabled==true) {

     //Make sure a text box is filled
    if (document.theForm.ImageUpload.value=="") {
        theMessage = theMessage + "\n --> Please choose a graphic to upload.";
    } else {

}

// If no errors, submit the form
if (theMessage == noErrors) {
return true;

} else {

// If errors were found, show alert message
alert(theMessage);
return false;
}
}



There are no errors but no validation either...I need help!


Reply With Quote





Similar Threads
Thread Thread Starter Forum Replies Last Post
I need help to make this enabled thing program... psycoblaster Visual Basic 2005 Basics 0 November 27th, 2007 07:36 AM
Ajax enabled website priyan.viji .NET Framework 2.0 0 August 20th, 2007 04:33 AM
Authentication is not enabled ayyub123 ASP.NET 2.0 Basics 0 May 29th, 2007 01:49 AM
Trigger Enabled or Disabled? smshinde Oracle 2 March 1st, 2007 06:02 AM
How to detect whether cookie is enabled or not. lily611 Javascript 2 July 26th, 2005 03:53 AM





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