다중셀렉트 소스를 구했는데, 값을 그누에 전달할려고 하면..

http://phpschool.com/gnuboard4/bbs/board.php?bo_table=tipntech&wr_id=5865&sca=&sfl=wr_subject%7C%7Cwr_content&stx=%B4%D9%C1%DF%BC%BF%B7%BA%C6%AE&sop=and

여기저기 뒤지다가, 이곳사이트를 알려주신글이 있어서 들어갔더니..
아래와 같은 소스를 발견했습니다.

2중 셀렉트가 잘되더군요...

근데 이걸 그누에서 선택된 값을 가져오려고 합니다.

가 a b c
나 d e f g 이렇게 된거에서

첫번째 나를 선택하고 f를 선택했을때

이것을 wr_1 에 나의 값을 넣어주고
wr_2에 f 를 넣어 주려고 합니다.

php 상에서...

$wr_1=SecondSelectValue[1]
$wr_2= SecondSelectValue[2]

하면 되는거 아닌가요

아무리 해도 값이 안넘어 오네요..

어찌하면 되나요 ?




<Script Language='javaScript'>
<!--
//==========================================================//
// Element 및 값 정의
//==========================================================//

FirstSelectName = "sel1";// 처음 Select Element의 이름
SecondSelectName = "sel2";// 두번째 Select Element의 이름

FirstSelectText = new Array("가","나");
FirstSelectValue = new Array("a","b");

SecondSelectText = new Array();
SecondSelectValue = new Array();

SecondSelectText[0] = new Array("A","B","C");
SecondSelectText[1] = new Array("D","E","F","G");
SecondSelectValue[0] = new Array("A","B","C");
SecondSelectValue[1] = new Array("D","E","F","G");

//==========================================================//
//-->
</script>


<Script Language='JavaScript'>
<!--
// 현재의 Element들이 속해있는 form의 위치를 자동으로 찾차주는 함수
thisFormCheckString = "This_is_Dynamic_Select_Form";
document.write("<input type='hidden' name='"+thisFormCheckString+"'>");
function FindThisFormName()
{
var d = document;
var n = d.forms.length;
if(n == 0)return 0;

for(var i=0;i<n;i++)
{
var e = d.forms[i].elements;
for(var x=0;x<e.length;x++)
{
if(e[x].name == thisFormCheckString)
return i;
}
}

return "_Nothing_";
}

thisFormName = FindThisFormName();// 현재폼
if(thisFormName == "_Nothing_")
{
var FormIsCreated = "Dynamic_Select_Form";
thisFormName = FormIsCreated;
document.write("<form name='"+FormIsCreated+"'>");
}

function CreateSecondSelect()
{
var f = document.forms[thisFormName];
var n = f[FirstSelectName].selectedIndex;
var l = SecondSelectText[n].length;
f[SecondSelectName].options.length = l;

for(var i=0;i<l;i++)
{
f[SecondSelectName].options[i].text = SecondSelectText[n][i];
f[SecondSelectName].options[i].value = SecondSelectValue[n][i];
}
f[SecondSelectName].selectedIndex=0;
}
//-->
</script>


<Script Language='JavaScript'>
<!--
document.write("<select name='"+FirstSelectName+"' onChange='CreateSecondSelect()'>");
for(var i=0;i < FirstSelectText.length;i++)
document.write("<option value='"+FirstSelectValue[i]+"'>"+FirstSelectText[i]+"</option>");
document.write("</select>");
//-->
</script>


<Script Language='JavaScript'>
<!--
document.write("<select name='"+SecondSelectName+"'>");
document.write("<option value=''></option>");
document.write("</select>");

if(FormIsCreated) document.write("</form>");
CreateSecondSelect();
//-->
</script>
|

댓글 4개

<select 이름을

앞에 것은 name="wr_1"
뒤에 것을 name="wr_2"로 해 보세요.
FirstSelectName 대신 wr_1 로 바꾸라는 말씀이시죠? 해당변수들을 전부 바꿔&#48168;는데
변함이 없네요....

변수값을 왜 받을려고 하냐면,

첫번째 선택하고 두번째 선택하면 그값을 세번째 자리에다 나타나게 하려고 하는건데요.

그니까....

나 e 를 선택했다면

나 e 나&e 이렇게요...

세번째 자리에 나&e는 두번째 에서 e를 선택하면 자동으로 나타나게 하려고 합니다.
어찌해야 되는지 모르겠네요...
검색하시려는 겁니깡?

wr_1 이나 wr_2 로 검색하실려면요

게시판경우 list.php 손보셔야 하구요

전체검색일경우 serach.php 부분을 손보셔야 다중검색이 가능합니다.
댓글을 작성하시려면 로그인이 필요합니다. 로그인

그누4 질문답변

그누보드4 관련 질문은 QA 로 이전됩니다. QA 그누보드4 바로가기 기존 게시물은 열람만 가능합니다.

+
제목 글쓴이 날짜 조회
17년 전 조회 1,538
17년 전 조회 1,377
17년 전 조회 1,523
17년 전 조회 1,579
17년 전 조회 1,517
17년 전 조회 1,559
17년 전 조회 1,534
17년 전 조회 1,814
17년 전 조회 1,454
17년 전 조회 1,540
17년 전 조회 1,595
17년 전 조회 1,508
17년 전 조회 1,520
17년 전 조회 1,192
17년 전 조회 1,696
17년 전 조회 1,975
17년 전 조회 1,687
17년 전 조회 1,187
17년 전 조회 1,966
17년 전 조회 1,642
🐛 버그신고