ご不明な点は管理画面右上の 「お問い合せ」をご利用ください。
futureshopサンプル店舗
商品検索
レイアウトスタイル別一覧
商品のいろいろな表示
商品のいろいろな表示 応用編
コンテンツページ
会員登録
メルマガ登録
商品カテゴリ一覧 > 商品ページのいろいろな表示 > チェックボックス検索フォーム > 今回使っている基本のソースはこちら
function setCheckBox2Text()
{
var strSep = " "; // 区切り文字
var txtVal = ""; // テキストボックスに表示される値
if (document.frm.chk1.checked){ // チェックされているか?
txtVal += document.frm.chk1.value; // されている場合は、値を確保
}
if (document.frm.chk2.checked){
if (txtVal != "") { // 既に値がある場合は、区切り文字を追加
txtVal += strSep;
}
txtVal += document.frm.chk2.value;
}
if (document.frm.chk3.checked){
if (txtVal != "") {
txtVal += strSep;
}
txtVal += document.frm.chk3.value;
}
if (document.frm.chk4.checked){
if (txtVal != "") {
txtVal += strSep;
}
txtVal += document.frm.chk4.value;
}
if (document.frm.chk5.checked){
if (txtVal != "") {
txtVal += strSep;
}
txtVal += document.frm.chk5.value;
}
if (document.frm.chk6.checked){
if (txtVal != "") {
txtVal += strSep;
}
txtVal += document.frm.chk6.value;
}
if (document.frm.chk7.checked){
if (txtVal != "") {
txtVal += strSep;
}
txtVal += document.frm.chk7.value;
}
if (document.frm.chk8.checked){
if (txtVal != "") {
txtVal += strSep;
}
txtVal += document.frm.chk8.value;
}
// テキストボックスに表示
document.frm.keyword.value = txtVal;
}
</SCRIPT>
<form action="http://c03.future-shop.jp/fs/sample/GoodsSearchList.html" method="get" name="frm"onSubmit="return setCheckBox2Text()">
<INPUT name="chk1" type="checkbox" value="【野菜】">野菜
<INPUT name="chk2" type="checkbox" value="【果物】">くだもの
<INPUT name="chk3" type="checkbox" value="【国産】">国産
<INPUT name="chk4" type="checkbox" value="【外国産】">外国産
<INPUT name="chk5" type="checkbox" value="【赤い】">赤い
<INPUT name="chk6" type="checkbox" value="【オレンジ】">オレンジ
<INPUT name="chk7" type="checkbox" value="【緑】">緑
<INPUT name="chk8" type="checkbox" value="【黄色】">黄色
<BR>
<INPUT name="keyword" type="hidden">
<BR> <INPUT type="submit" value="検索する" >
</FORM>