Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Fastest way to retrieve checked fields
Message
From
06/08/2001 10:18:34
 
 
General information
Forum:
Internet
Category:
Javascript
Miscellaneous
Thread ID:
00538718
Message ID:
00540141
Views:
29
>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
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform