Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Fastest way to retrieve checked fields
Message
 
 
À
02/08/2001 02:46:40
Information générale
Forum:
Internet
Catégorie:
Javascript
Divers
Thread ID:
00538718
Message ID:
00540075
Vues:
19
Hi!

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.

When you want to speed up the process by omitting checking for 'Message*' name, make a form that contains only these checkboxes, if possible. You can also name each checkbox by the same name. That name become an array of checkboxes that you can loop through. However, you will require also to populate another property of checkbox by the ID value.

Cannot post code samples yet, have no time and help file for IE objects model handy.

>I have a table with 100 records. Each record contains a checkbox field with the unique ID of the record. I also have a hidden field of that form which contains all my ID. So, MessageMark contains Message2323,Message6454,Message3524,Message0090,...
>
>The user may check several records. At the javascript level, before submitting the form, I need to know which checkboxes have been checked and store them into MessageMarkFinal.
>
>Normally, I will do that code in Visual FoxPro. This time I have to do it before submitting the form. What would be the fastest way to scan the MessageMark variables to retrieve the checked variables into MessageMarkFinal?
>
>The table is like this:
>
>INPUT TYPE=Checkbox NAME=Message2323
>INPUT TYPE=Checkbox NAME=Message6454
>INPUT TYPE=Checkbox NAME=Message3524
>INPUT TYPE=Checkbox NAME=Message0090
>
>The hidden field is like this:
>INPUT TYPE=Hidden NAME=MessageMark VALUE=Message2323,Message6454,Message3524,Message0090,...
>
>Assuming record 2 and 4 are checked, I should have this in MessageMarkFinal:
>
>INPUT TYPE=Hidden NAME=MessageMarkFinal VALUE=Message6454,Message0090
Vlad Grynchyshyn, Project Manager, MCP
vgryn@yahoo.com
ICQ #10709245
The professional level of programmer could be determined by level of stupidity of his/her bugs

It is not appropriate to say that question is "foolish". There could be only foolish answers. Everybody passed period of time when knows nothing about something.
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform