begin process at 2010 02 09 06:51:55
  Trouver un code source :
 
dans
 
Accueil > Forum > 

ColdFusion

 > 

Base de données

 > 

Autre

 > 

Error: Element <Variable name> is undefined in FORM!!


Derniers messages déposésPoser une question dans le forum ou lancer une discussion

Error: Element <Variable name> is undefined in FORM!!

mercredi 14 mars 2007 à 08:45:30 | Error: Element <Variable name> is undefined in FORM!!

nada26

Salut a tous!!


J'ai un drop-down list dinamic :

<form name="formTwo" method = "post" >
   <fieldset id="Program Location">
      <legend>Program Location</legend>
        <p><label class="text" for="Location">Location</label>
   
   <select name = "COID" size = "1" class = "text" id = "COID" onchange = "setOptions(document.formTwo.COID.options[document.formTwo.COID.selectedIndex].value);" >
            <option value="1" selected >China</option>
      
            <option value="2" >France</option>
      
            <option value="3" >Spain</option>
      
            <option value="4" >Italy</option>
      
            <option value="5" >Japan</option>
      
            <option value="6" >Australia</option>
      
            <option value="7" >South Korea</option>
      
            <option value="8" >Germany</option>
      
            <option value="9" >United Kingdom</option>
         </select>
    </p>
    <p><label class="text" for="CITY">City Location</label></p>
    <select name="CITY" id="CITY" class="text" >
      <option value="" selected="selected">Please Select One Of The Locations Above </option>
           
          </select>
          <hr/>
    </fieldest>
 

La Fonction setOptions() :

function setOptions(chosen) {

  var locbox = document.formTwo.CITY;
  
  
  locbox.options.length = 0;
  if (chosen == ""){
   locbox.options[locbox.options.length]=new Option('Please select one of the locations above first',' ');
   }
  if (chosen == "1") {
   locbox.options[locbox.options.length] = new Option('Beijing','Beijing' );
   locbox.options[locbox.options.length] = new Option('Shanghai','Shanghai' );
 
 }
 if (chosen == "2") {
   locbox.options[locbox.options.length] = new Option('Paris','Paris' );
   locbox.options[locbox.options.length] = new Option('Nice', 'Nice');
   locbox.options[locbox.options.length] = new Option('Annecy','Annecy');
   locbox.options[locbox.options.length] = new Option('Chambery','Chambery');
   locbox.options[locbox.options.length] = new Option('Bordeaux','Bordeaux');
 
   }
   if (chosen == "3") {
   locbox.options[locbox.options.length] = new Option('Madrid','Madrid' );
   locbox.options[locbox.options.length] = new Option('Barcelona', 'Barcelona');
   locbox.options[locbox.options.length] = new Option('Salamanca','Salamanca');
   locbox.options[locbox.options.length] = new Option('Marbella','Marbella');
   locbox.options[locbox.options.length] = new Option('Valencia','Valencia');
   }
   
   if (chosen == "4") {
   locbox.options[locbox.options.length] = new Option('Rome','Rome' );
   locbox.options[locbox.options.length] = new Option('Milan', 'Milan');
   locbox.options[locbox.options.length] = new Option('Venice','Venice');
   locbox.options[locbox.options.length] = new Option('Florence','Florence');
   }
   if (chosen=="5"){
 locbox.options[locbox.options.length] = new Option('Tokyo','Tokyo');
 }
   
 if (chosen == "6") {
   locbox.options[locbox.options.length] = new Option('Canberra','Canberra' );
   locbox.options[locbox.options.length] = new Option('Sydney', 'Sydney');
   locbox.options[locbox.options.length] = new Option('Perth','Perth');
    }

    if (chosen == "7"){
 locbox.options[locbox.options.length] = new Option('Seoul','Seoul');   
 }
 
  if (chosen == "8"){
 locbox.options[locbox.options.length] = new Option('Heidelberg','Heidelberg');   
 }
 
  if (chosen == "9"){
 locbox.options[locbox.options.length] = new Option('London','London');
 locbox.options[locbox.options.length] = new Option('Brighton','Brighton');
 locbox.options[locbox.options.length] = new Option('Cambridge','Cambridge');
 locbox.options[locbox.options.length] = new Option('Oxford','Oxford');
     
 }
}

Dans l'action page j'ai :  
<!--- Insert the new record --->
<cfquery name="external" datasource="program">
  INSERT INTO program(COID, CITY)
  VALUES ('#Form.COID#','#Form.CITY#')
</cfquery>

Alors j'ai une erreur :   Element COID is undefined in FORM.


Merci d'avance (Desole' pour mon francais ecrit,  je suis pas une francais )
Nada

vendredi 23 mars 2007 à 00:06:43 | Re : Error: Element <Variable name> is undefined in FORM!!

bastoun

c'est normal que tu n'aies pas de </form> ?
Et tu n'as pas d'attribut action dans ta balise form...


Cette discussion est classée dans : option, options, locbox, length, chosen


Répondre à ce message

Sujets en rapport avec ce message

SERVEUR DE MAIL COLDFUSION [ par omconq ] bonjour à tousj'voudrais utiliser cfmail pour l'envoie de mail .mais pour cela il faut configurer les serveur de mail (mail serveur) des options de l'


Nos sponsors


Appels d'offres

Sondage...

Comparez les prix

CalendriCode

Février 2010
LMMJVSD
1234567
891011121314
15161718192021
22232425262728

Consulter la suite du CalendriCode

 
Développement réalisé par Nicolas SOREL (Nix) avec l'aide de : Cyril DURAND et Emmanuel (EBArtSoft), Merci à Vincent pour ses précieux conseils.
CodeS-SourceS.com© Toute reproduction même partielle est interdite sauf accord écrit du Webmaster
CodeS-SourceS.com© est une marque déposée tous droits réservés

Google Coop CodeS-SourceS Google Coop CodeS-SourceS
Temps d'éxécution de la page : 0,749 sec (4)

Nous contacter | Annoncer sur CodeS-SourceS | Mentions légales