Dropdown as div contents

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • Fary4u
    Contributor
    • Jul 2007
    • 273

    Dropdown as div contents

    using standard dropdown box make as div contents & after click on the link to passing value & changing the color ?

    for example
    div color & size

    Founded in 1991 by Wicky Hassan, MISS SIXTY is the first brand focusing on women`s denim. View the latest everyday denim and fashion denim collections.
  • acoder
    Recognized Expert MVP
    • Nov 2006
    • 16032

    #2
    The problem isn't quite clear. Could you explain with a bit of code please.

    Comment

    • Fary4u
      Contributor
      • Jul 2007
      • 273

      #3
      Originally posted by acoder
      The problem isn't quite clear. Could you explain with a bit of code please.
      how do i change div, href or radio box instead of drop down lists

      if i need to convert dropdown values into div or radio box & passing value to the next page whats the best available fancy methods ?

      following link having the same option
      Founded in 1991 by Wicky Hassan, MISS SIXTY is the first brand focusing on women`s denim. View the latest everyday denim and fashion denim collections.


      available color & size are shown as div list & passing value & swaping the image.
      Code:
      <select name="cbo" class="styled"> 
        <option value="1">Option 1</option> 
        <option value="2">Option 2</option> 
        <option value="3">Option 3</option> 
      </select>

      Comment

      • acoder
        Recognized Expert MVP
        • Nov 2006
        • 16032

        #4
        OK, you can use divs or other elements instead of form elements and attach an onclick event handler which deals with the setting and passing of values.

        For example, you could set a hidden field if a particular div is clicked, or you could change the href of a link.

        What exactly do you want to do?

        Comment

        • Fary4u
          Contributor
          • Jul 2007
          • 273

          #5
          Originally posted by acoder
          OK, you can use divs or other elements instead of form elements and attach an onclick event handler which deals with the setting and passing of values.

          For example, you could set a hidden field if a particular div is clicked, or you could change the href of a link.

          What exactly do you want to do?
          thxs for reply, i'm trying to bring 2 type of list i've already got the list in dropdown.

          1st list:
          colors : Black | White | Red | Green

          2nd list:
          sizes : Small | Medium | Large | Xtra Large

          & some body click on the Black Color it's show's Black Image & bring the 2nd list

          or if some body click on Red color it's show's Red Image & bring the 2nd list

          Image should be JQuery Zoom effect just like the following link.
          Founded in 1991 by Wicky Hassan, MISS SIXTY is the first brand focusing on women`s denim. View the latest everyday denim and fashion denim collections.

          Comment

          • acoder
            Recognized Expert MVP
            • Nov 2006
            • 16032

            #6
            You can convert the drop down values to the divs using JavaScript, so that if JavaScript is not enabled the user can still select their options.

            Take the select element and its options and write a div which is styled appropriately for each option, so the first list would be converted to 4 divs with the values/colours of Black, Red, White and Green.

            Comment

            • Fary4u
              Contributor
              • Jul 2007
              • 273

              #7
              Originally posted by acoder
              You can convert the drop down values to the divs using JavaScript, so that if JavaScript is not enabled the user can still select their options.

              Take the select element and its options and write a div which is styled appropriately for each option, so the first list would be converted to 4 divs with the values/colours of Black, Red, White and Green.
              any example ? here is my example ?
              when you select the 1st dropdown using request query string taking value & pass it to 2nd dropdown.
              strprodcolor = Request.QuerySt ring("drpcolor" )

              Code:
              <SCRIPT language=JavaScript>
              	function reload(form){
              	var int1 = "<%= intProdID %>"
              	var int2 = "<%= intProdN %>"
              	var val=form1.drpcolor.options[form1.drpcolor.options.selectedIndex].value;
              	self.location='product_detail.asp?intProdID=' + int1 + '&intProdN=' + int2 + '&drpcolor=' + val ;
              	}
              </script>
              <select id="cboColours" name="drpcolor" onchange="reload(this.form)">
              	<option selected value="1">Make Selection</option>
              	<option selected value="1"><%= strprodcolor %></option>
              	<%=PopulateCombo(rsColours,"color_id","color_id")%>
              </select>
              <br>
              <select id="cboSizes" name="drpsize">
              <option selected value="1">Make Selection</option>
              <%=PopulateCombo(rsSizes,"size","stock")%>
              </select>

              Comment

              • acoder
                Recognized Expert MVP
                • Nov 2006
                • 16032

                #8
                There's no need to reload the page. You can do this without a page reload by loading the sizes on page load, e.g. something like:
                Code:
                var colsizes = {"Black":["Small","Medium","Large"],
                }

                Comment

                Working...