begin process at 2008 08 07 22:01:20
1 223 143 membres
483 nouveaux aujourd'hui
14 227 membres club

Vous ne trouvez pas de réponse à votre problème ? Alors posez la question dans le forum.
Souvenez-vous qu'il n'y a jamais de question bête, mais rester dans l'ignorance parce que l'on n'ose pas poser une question, ça c'est une erreur !

Sujet : Error: Element <Variable name> is undefined in FORM!! [ Base de données / Autre ] (nada26)

Error: Element <Variable name> is undefined in FORM!! le 14/03/2007 08:45:30

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


Re : Error: Element <Variable name> is undefined in FORM!! le 23/03/2007 00:06:43

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


Classé sous : option, options, locbox, length, chosen

Participer à cet échange

Sujets en rapport

Pub



Appels d'offres

Snippets en rapport

CalendriCode

Août 2008
LMMJVSD
    123
45678910
11121314151617
18192021222324
25262728293031

Téléchargements

Logiciels à télécharger sur le même thème :

Boutique

Boutique de goodies CodeS-SourceS