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

nada26 Messages postés 1 Date d'inscription mercredi 14 mars 2007 Statut Membre Dernière intervention 14 mars 2007 - 14 mars 2007 à 08:45
cs_bastoun Messages postés 164 Date d'inscription dimanche 1 octobre 2000 Statut Membre Dernière intervention 23 mars 2007 - 23 mars 2007 à 00:06
Salut a tous!!

J'ai un drop-down list dinamic :

<form name="formTwo" method = "post" >
   <fieldset id="Program Location">
      <legend>Program Location</legend>
        <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>
    

    <label class="text" for="CITY">City Location</label>

    <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
A voir également:

1 réponse

cs_bastoun Messages postés 164 Date d'inscription dimanche 1 octobre 2000 Statut Membre Dernière intervention 23 mars 2007 1
23 mars 2007 à 00:06
c'est normal que tu n'aies pas de </form> ?
Et tu n'as pas d'attribut action dans ta balise form...
0
Rejoignez-nous