Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Fastest way to retrieve checked fields
Message
De
06/08/2001 10:18:34
 
 
Information générale
Forum:
Internet
Catégorie:
Javascript
Divers
Thread ID:
00538718
Message ID:
00540141
Vues:
18
>Well, I wondered because checkbox values could be catched at the server side in the ASP scripts. Anyway, if you want that in such form, loop through all controls of the form. Array in Java Script have count property. In the loop check if control's name start from 'Message', if yes, get checked status and put into result string the name, if required.

The reason to do it at the page level is because that page is not firing anything at the server but it is updating a value from another page.

This is what I came up with:
function MessageMark(theForm)
{
   lcField=""
   lcValue=""
   lcMessageMark=""
   for (i = 0; i < theForm.length; i++)
      {
      lcField=theForm.elements[i].name
      lcValue=lcField.substring(7,13)
      floatValue=parseFloat(lcValue)
      if (!isNaN(floatValue))
         {
         if (theForm.elements[i].checked==true)
            {
            lcMessageMark=lcMessageMark+lcValue+","
            }
         }
      }
   if (lcMessageMark.length>0)
      {
      lcMessageMark=lcMessageMark.substring(0,lcMessageMark.length-1)
      }
   return lcMessageMark
}
Michel Fournier
Level Extreme Inc.
Designer, architect, owner of the Level Extreme Platform
Subscribe to the site at https://www.levelextreme.com/Home/DataEntry?Activator=55&NoStore=303
Subscription benefits https://www.levelextreme.com/Home/ViewPage?Activator=7&ID=52
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform