submitting all select box options

Results 1 to 2 of 2

Thread: submitting all select box options

  1. #1
    Join Date
    Dec 1969

    Default submitting all select box options

    Hi <BR><BR>I have a form with a selection box that the user adds to. When the user submits the form I want to add all the entries in the select box to the database. Is there anyway to select all the items and then submit the form in vbscript. I have tried selecting all the items as i add them but it looks terrible and I know the first thing the user is going to do is unselect them.<BR> <BR><BR>Also is it possible to access the variables and functions on an asp page from a vbscript or javascript function. I can get it working in Javascript but then can&#039;t access any of my asp functions or variables. <BR><BR>thanks,<BR>Sinead<BR><BR>

  2. #2
    Join Date
    Dec 1969

    Default RE: submitting all select box options

    Answer 1:<BR><BR>&#060;SCRIPT Language=JavaScript&#062;<BR>function selectAllOptions( sel )<BR>{<BR>&nbsp; &nbsp; for ( var ix = 0; ix &#060; sel.options.length; ++ix )<BR>&nbsp; &nbsp; &nbsp; &nbsp; sel.options[ ix ].selected = true;<BR>}<BR>&#060;/SCRIPT&#062;<BR><BR>&#060;FORM ... onSubmit="selectAllOptions(this.theSelect); return true;"&#062;<BR>...<BR>&#060;SELECT Multiple Name="theSelect"&#062;<BR>...<BR>&#060;/SELECT&#062;<BR>...<BR>&#060;/FORM&#062;<BR><BR>******************************** **<BR><BR>Answer 2:<BR><BR>See the ASPFAQs (category "The Nature of Things"). The link to the ASPFAQs is at the top right corner of most every page on this site, including this one.<BR><BR>Short answer: No. Longer answer: It depends on what you mean by "access".<BR><BR>

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts