Results 1 to 2 of 2

Thread: Translation

  1. #1
    Join Date
    Dec 1969

    Default Translation

    I apologize in advance for the client side nature of this question...I need to be able to reference option values in a drop down list if possible in VBScript. From what I&#039;ve seen in Javascript, it references the index number like so:<BR><BR>&#060;SCRIPT LANGUAGE="JavaScript"&#062; <BR> var numItems = 0;* // manual list counter <BR> <BR> function addIt() { <BR> var txt = document.entryForm.entry.value; <BR> addOption = new Option(txt,txt);<BR> document.entryForm.entryList.options[numItems++] = addOption; <BR> return true;<BR> } <BR> <BR> &#060;/SCRIPT&#062; <BR><BR>* <BR><BR>OK, so in VBScript you reference the document.entryForm.entryList object the same way, but after that , the options piece and the index number I can&#039;t figure out how to reference. Any help would be appreciated.<BR>

  2. #2
    Join Date
    Dec 1969

    Default RE: Translation

    &#060;script language="VBScript"&#062;<BR><BR>Dim numItems: numItems = 0<BR><BR>Function addIt()<BR> Dim txt: txt = document.entryForm.entry.value<BR> Dim addOption: addOption = New Option(txt, txt)<BR> numItems = numItems + 1<BR> document.entryForm.entryList.options[numItems] = addOption<BR> addIt = true<BR>End Function<BR><BR>&#060;/script&#062;<BR><BR>Or similar... <BR><BR>Craig.

Posting Permissions

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