codetoad.com
  ASP Shopping CartForum & BBS
  - all for $20 from CodeToad Plus!
  
  Home || ASP | ASP.Net | C++/C# | DHTML | HTML | Java | Javascript | Perl | VB | XML || CodeToad Plus! || Forums || RAM 
Search Site:
Search Forums:
  simple function won`t work...  jcavard at 01:00 on Wednesday, August 17, 2005
 

Hi

why won't this work??

<script type="text/javascript">
function displaymessage(n)
{

var test;
test = false;
switch(n)
{
case 1:
if(document.forms1.id.options[document.forms1.id.selectedIndex].value == "")
{
test = true;
}
break;
case 4:
for(i=0;i<4;i++){
if(document.forms1.elements.value =="")
{
test = true;
}
}
break;
default:
break;
}
document.form1.Submit.disabled=test;
}


</script>

  Re: simple function won`t work...  proghelper at 18:37 on Wednesday, August 24, 2005
 

Hi

1. Name of the form should be either "forms1" or "form1"

2. do not use names such as "Submit" and "id" for input elements.

3. use document.form1.submit =test;

instead of "document.form1.Submit.disabled=test;"

(submit is action of submitting the form)

john

http://www.programminghelp4u.com ( Assignment / Project ) Help








CodeToad Experts

Can't find the answer?
Our Site experts are answering questions for free in the CodeToad forums








Recent Forum Threads
•  Why Use Method?
•  Re: Help with filesystem object & displaying in a table
•  Re: Genetic Algorithm Help
•  Re: How to make an investment calculator
•  Re: line breaks in GUI
•  Re: Graph in Gui...
•  Graph in Gui...
•  Re: Counting zero values in a string
•  Re: Help!


Recent Articles
Multiple submit buttons with form validation
Understanding Hibernate ORM for Java/J2EE
HTTP screen-scraping and caching
a javascript calculator
A simple way to JTable
Java Native Interface (JNI)
Parsing Dynamic Layouts
MagicGrid
Caching With ASP.Net
Creating CSS Buttons


Site Survey
Help us serve you better. Take a five minute survey. Click here!

© Copyright codetoad.com 2001-2005