Jump to content

Recommended Posts

Hi

 

I've been trying to display some list items in drop down boxes. The list holds items such as

 

Product

Design

Size

Paper

Color

Finish

Quantity

Total

Turnaround

 

I Agree (check box)

Am intending to do this :

It needs to be able to add products to or change prices

and for members a little cheaper.

 

and then I need one that just multiplies length and height. and multiplies it by price per sq. ft.

 

Can you please gimme ideas as to how can i use do this, i mean to be able to add products and check if member then show cheaper prices and then do the multiple.

 

Any help is highly appreciated!

 

Thanks in advance

Jyothi

Link to comment
https://forums.phpfreaks.com/topic/51946-some-issue-with-drop-down-boxes/
Share on other sites

FIrst i fill in the first list of the box, then i fill in the second list box dynamically based on the values selected in the first box. As an example , shown below

 

function fillCategory(){

// this function is used to fill the category list on load

addOption(document.drop_list.Category, "Products", "Products", "");

addOption(document.drop_list.Category, "Design", "Design", "");

addOption(document.drop_list.Category, "Size", "Size", "");

addOption(document.drop_list.Category, "Paper", "Paper", "");

addOption(document.drop_list.Category, "Color", "Color", "");

addOption(document.drop_list.Category, "Finish", "Finish", "");

addOption(document.drop_list.Category, "Quantity", "Quantity", "");

addOption(document.drop_list.Category, "Total", "Total", "");

addOption(document.drop_list.Category, "Turnaround", "Turnaround", "");

}

 

function SelectSubCat()

{

// ON selection of category this function will work

removeAllOptions(document.drop_list.SubCat);

addOption(document.drop_list.SubCat, "", "SubCat", "");

 

if(document.drop_list.Category.value == 'Products')

{

addOption(document.drop_list.SubCat,"TV", "TV");

addOption(document.drop_list.SubCat,"Mobile", "Mobile");

addOption(document.drop_list.SubCat,"Laptop", "Laptop");

}

if(document.drop_list.Category.value == 'Design')

{

addOption(document.drop_list.SubCat,"ABC", "ABC");

addOption(document.drop_list.SubCat,"XYZ", "XYZ");

addOption(document.drop_list.SubCat,"PRQ", "PRQ", "");

}

if(document.drop_list.Category.value == 'Size')

{

addOption(document.drop_list.SubCat,"10", "10");

addOption(document.drop_list.SubCat,"05", "05");

addOption(document.drop_list.SubCat,"15", "15");

}

}

 

function removeAllOptions(selectbox)

{

var i;

for(i=selectbox.options.length-1;i>=0;i--)

{

//selectbox.options.remove(i);

selectbox.remove(i);

}

}

 

 

function addOption(selectbox, value, text )

{

var optn = document.createElement("OPTION");

optn.text = text;

optn.value = value;

 

selectbox.options.add(optn);

}

 

 

But am still trying to figure out how can i show the price cheaper for members and change the weight height!!

 

If any ideas on this, it would be of great help.

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.