こんにちは、私はjavascriptを使い慣れていないので、いくつかのオプションを使ってフォームを作成しようとしています。Javascript selectbox
私はWood Floor Restoration Companyのサイトを構築していますが、ユーザーはいくつかのオプションを記入しておおよその価格ガイドを入手できるフォームが必要です。
だから私はSmartFormerを使用してフォームを作成したが、床の異なる5種類のリストボックスを使用しちゃったごめんなさい
を持ってきた、あなたはリストボックスにパインフロアを選択言って、それは、その後の仕上げの種類を示しています選択ボックスの現在のフロアで、私がしたいことは、それぞれの仕上げごとに異なる値に設定されます。現在、Finish - Original Never Sandedを選択した場合、現在はすべて同じ値(500)を示します。 WaxedまたはOiledを選択すると、値が異なるので、どのように変更するのですか。
以下は、誰かが私が変更や追加が必要なことを教えてもらえれば、私は極端に感謝しています。 http://jsfiddle.net/jchandra/Q8J7F/
私はわからないどのようにSmartFormer事の仕事を、私は、私はあなたに継続する方法についてのアイデアを与えるために十分な詳細を再構築だと思う:
おかげ
function add_item(id,val,_obj) {
tmp=document.createElement("OPTION");http://localhost/mcmullan/administrator/components/com_smartformer/plugins/edit_area/images/spacer.gif
tmp.value=id;
tmp.text=val;
_obj.options.add(tmp);
}
function boards_change(field) {
if (field.selectedIndex==0) {
while ({%id28}.options.length>0) {%id28}.remove(0);
add_item(0,'-- Please select --',{%id28});
add_item(1,'Pine Boards- Original Never Sanded',{%id28});
add_item(2,'Pine Boards- Sanded & Varnished/Lacquered',{%id28});
add_item(3,'Pine Boards- Sanded & Varnished/Lacquered',{%id28});
{%id31}.value='500';
} else
if (field.selectedIndex==1) {
while ({%id28}.options.length>0) {%id28}.remove(0);
add_item(0,'-- Please select --',{%id28});
add_item(1,'Mosaic - Sanded & Varnished/Lacquered',{%id28});
add_item(2,'Mosaic - Sanded & Varnished/Lacquered',{%id28});
add_item(3,'Mosaic - Sanded & Varnished/Lacquered',{%id28});
{%id31}.value='600';
} else
if (field.selectedIndex==2) {
while ({%id28}.options.length>0) {%id28}.remove(0);
add_item(0,'-- Please select --',{%id28});
add_item(1,'Herringbone - Sanded & Varnished/Lacquered',{%id28});
add_item(2,'Herringbone- Sanded & Varnished/Lacquered',{%id28});
add_item(3,'Herringbone- Sanded & Varnished/Lacquered',{%id28});
{%id31}.value='700';
} else
if (field.selectedIndex==3) {
while ({%id28}.options.length>0) {%id28}.remove(0);
add_item(0,'-- Please select --',{%id28});
add_item(1,'Hardwood - Sanded & Varnished/Lacquered',{%id28});
add_item(2,'Hardwood - Sanded & Varnished/Lacquered',{%id28});
add_item(3,'Hardwood - Sanded & Varnished/Lacquered',{%id28});
{%id31}.value='800';
} else
if (field.selectedIndex==4) {
while ({%id28}.options.length>0) {%id28}.remove(0);
add_item(0,'-- Please select --',{%id28});
add_item(1,'Engineered Boards- Sanded & Varnished/Lacquered',{%id28});
add_item(2,'Engineered Boards- Sanded & Varnished/Lacquered',{%id28});
add_item(3,'Engineered Boards- Sanded & Varnished/Lacquered',{%id28});
{%id31}.value='900';
}
calculate_price();
}
function calculate_price() {
if({%id31}.value-0>0) {%id52}.value=({%id32}.selectedIndex+1)*({%id31}.value-0)+({%id35}.selectedIndex+1)*({%id31}.value-0)*10;
else {%id52}.value='';
}
'{%id28} 'とは何ですか? – SLaks