Loading ...
Sorry, an error occurred while loading the content.

Passing Select Values

Expand Messages
  • melbourne1958m
    Hi, This setcat() function when called from an onChange event and terminated with alert (CATEGORY+SUBCATEGORY); produces the desired
    Message 1 of 36 , Apr 14, 2001
      Hi,<br><br>This setcat() function when called
      from an onChange event and terminated<br>with alert
      (CATEGORY+SUBCATEGORY); produces the desired result.<br><br>function
      setcat(){<br>var val1;<br>var val2;<br>var CATEGORY;<br>var
      SUBCATEGORY;<br>val1=form1.mainlist.value;<br>val2=form1.sublist.value;<br>CATEGORY=MainList[val1].description;<br>SUBCATEGORY=SubList[val1].description;<br>}<br><br>mainlist and sublist hold the values corresponding to
      :<br>MainList[0]=new ListItem(0,"Announcements");<br>MainList[1]=new
      ListItem(1,"Employment");<br><br>and<br>SubList[0]=new ListSubItem(0,0,"Lost &
      Found");<br>SubList[1]=new ListSubItem(1,1,"Domestic");<br>SubList[2]=new
      ListSubItem(1,2,"Secretarial");<br><br>CATEGORY and SUBCATEGORY are receiving the descriptions
      for instance if<br>mainlist = 1, sublist =
      2<br>CATEGORY = Employment and<br>SUBCATEGORY =
      Secretarial<br><br>These values will display if called by an alert in a
      function.<br><br>If CATEGORY=mainlist and SUBCATEGORY=sublist as in
      this example, a 1 and 2<br>will be passed to the ASP
      file and written as new category and
      subcategory<br>elements in the XML file.<br><br> CATEGORY and SUBCATEGORY
      are onot being added to the forms output. I think my
      hidden fields are not receiving the descriptions but it
      is hard<br>to say. No error occurs, only empty
      category and subcategory elements are<br>created in the
      xml file.<br><br>In the ASP are variables
      SName=Request("NAME"), SPhone=Request("Phone"),<br>etc.<br>If
      sCategory=Request("mainlist") I get the index value.
      If<br>sCategory=Request("CATEGORY") I get nothing.<br><br>I am using <input
      type="hidden" name="CATEGORY"> This I have placed in
      the<br>table along with the working <input type="text
      name="NAME"> entries.<br><br>The ASP creates XML elements name
      phone etc and gives those elements the<br>values held
      by sName,SPhone, etc.<br><br>Please tell me what I
      am missing. <br><br><br>Thank you for your patience
      and efforts on my
      behalf.<br><br>Sincerely,<br><br>Paul Hickey
    • web4christ65
      here s something I worked up to deal with your post. it s not exactly the string.split method; I couldn t find that in the specs included in the PWS
      Message 36 of 36 , Dec 23, 2001
        here's something I worked up to deal with your
        post. it's not exactly the string.split method; I
        couldn't find that in the specs included in the PWS
        documentation so I built my own. you can get it from my web
        site at <a href=http://www.jnbmerrill.com/split.zip target=new>http://www.jnbmerrill.com/split.zip</a> inside of
        which you'll find an asp file that you should be able
        to follow easily.
      Your message has been successfully submitted and would be delivered to recipients shortly.