HULP BIJ PHP FORMULIER
Ik heb een script waar ik een kleine aanpassing wil maken, maar ik kom er zelf niet uit :(
Op het script kan commentaar geplaatst worden.
Nu wil ik dat inplaats van het commentaar, dat er een soort dropdownbox komt (en dat ik de keuze van de dropdown ook kan nalezen in het admin gedeelte)
Als iemand mij hiermee kan helpen, zou dat echt tegek zijn!!!!
Hier volgt het commentaar script(gedeelte):
Code (php)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
<?PHP
echo '
</div>';
}
if ($settings['comments'] == 1) {
echo '
<h2>', $lang['profile_comments'] ,'</h2>
<div class="content_box">
<div id="comments" style="position: relative;">';
load_template('profile_comments');
echo '
</div>';
if ($session->info['status'] == 1) {
echo '
', $lang['leave_comment'] ,':
<div id="comment_error" class="error_box" style="display:none;"></div>
<div id="comment_form">
<div style="float: left; width: 300px;">
<textarea name="message" id="message" rows="3" cols="39"></textarea><br />
<input type="submit" id="submit_comment" value="', $lang['submit'] ,'" onclick="submit_pcomment(', $profile['id'] ,'); return false;" />
<img src="', $settings['siteurl'] ,'/images/load.gif" id="loader" style="display: none" alt="" />
</div>
<div style="float: right; width: 300px;">
<img src="', $settings['siteurl'] ,'/images/happy.gif" style="cursor: pointer;" onclick="emoticon(\' :) \', \'message\');" alt="" />
<img src="', $settings['siteurl'] ,'/images/sad.gif" style="cursor: pointer;" onclick="emoticon(\' :( \', \'message\');" alt="" />
<img src="', $settings['siteurl'] ,'/images/wink.gif" style="cursor: pointer;" onclick="emoticon(\' ;) \', \'message\');" alt="" />
<img src="', $settings['siteurl'] ,'/images/@.gif" style="cursor: pointer;" onclick="emoticon(\' :@ \', \'message\');" alt="" />
<img src="', $settings['siteurl'] ,'/images/cool.gif" style="cursor: pointer;" onclick="emoticon(\' :8 \', \'message\');" alt="" /><br />
<img src="', $settings['siteurl'] ,'/images/wave.gif" style="cursor: pointer;" onclick="emoticon(\' :wave: \', \'message\');" alt="" />
<img src="', $settings['siteurl'] ,'/images/think.gif" style="cursor: pointer;" onclick="emoticon(\' :think: \', \'message\');" alt="" />
<img src="', $settings['siteurl'] ,'/images/clap.gif" style="cursor: pointer;" onclick="emoticon(\' :clap: \', \'message\');" alt="" />
</div>
<div style="clear: both;"></div>
</div>';
}
echo '
</div>';
}
echo '
</div>';
} // end function
?>
echo '
</div>';
}
if ($settings['comments'] == 1) {
echo '
<h2>', $lang['profile_comments'] ,'</h2>
<div class="content_box">
<div id="comments" style="position: relative;">';
load_template('profile_comments');
echo '
</div>';
if ($session->info['status'] == 1) {
echo '
', $lang['leave_comment'] ,':
<div id="comment_error" class="error_box" style="display:none;"></div>
<div id="comment_form">
<div style="float: left; width: 300px;">
<textarea name="message" id="message" rows="3" cols="39"></textarea><br />
<input type="submit" id="submit_comment" value="', $lang['submit'] ,'" onclick="submit_pcomment(', $profile['id'] ,'); return false;" />
<img src="', $settings['siteurl'] ,'/images/load.gif" id="loader" style="display: none" alt="" />
</div>
<div style="float: right; width: 300px;">
<img src="', $settings['siteurl'] ,'/images/happy.gif" style="cursor: pointer;" onclick="emoticon(\' :) \', \'message\');" alt="" />
<img src="', $settings['siteurl'] ,'/images/sad.gif" style="cursor: pointer;" onclick="emoticon(\' :( \', \'message\');" alt="" />
<img src="', $settings['siteurl'] ,'/images/wink.gif" style="cursor: pointer;" onclick="emoticon(\' ;) \', \'message\');" alt="" />
<img src="', $settings['siteurl'] ,'/images/@.gif" style="cursor: pointer;" onclick="emoticon(\' :@ \', \'message\');" alt="" />
<img src="', $settings['siteurl'] ,'/images/cool.gif" style="cursor: pointer;" onclick="emoticon(\' :8 \', \'message\');" alt="" /><br />
<img src="', $settings['siteurl'] ,'/images/wave.gif" style="cursor: pointer;" onclick="emoticon(\' :wave: \', \'message\');" alt="" />
<img src="', $settings['siteurl'] ,'/images/think.gif" style="cursor: pointer;" onclick="emoticon(\' :think: \', \'message\');" alt="" />
<img src="', $settings['siteurl'] ,'/images/clap.gif" style="cursor: pointer;" onclick="emoticon(\' :clap: \', \'message\');" alt="" />
</div>
<div style="clear: both;"></div>
</div>';
}
echo '
</div>';
}
echo '
</div>';
} // end function
?>
en hier de dropdownbox die ik wil laten implementeren:
Code (php)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
<?PHP
<SCRIPT LANGUAGE="JavaScript">
<!--
function onChange(object) {
var Current = object.selectName.selectedIndex;
object.currentText.value = object.selectName.options[Current].text;
object.currentValue.value = object.selectName.options[Current].value;
}
function deleteOption(object) {
var Current = object.selectName.selectedIndex;
object.selectName.options[Current] = null;
}
function addOption(object) {
var defaultSelected = true;
var selected = true;
var optionName = new Option(object.currentText.value, object.currentValue.value, defaultSelected, selected)
var length = object.selectName.length;
object.selectName.options[length] = optionName;
}
function replaceOption(object) {
var Current = object.selectName.selectedIndex;
object.selectName.options[Current].text = object.currentText.value;
object.selectName.options[Current].value = object.currentText.value;
}
//-->
</SCRIPT>
<FORM NAME="formName3" onSubmit="return false;">
<SELECT NAME="selectName" onChange="onChange(this.form)">
<OPTION VALUE="Option 0" SELECTED>Entry 0
<OPTION VALUE="Option 1">Entry 1
<OPTION VALUE="Option 2">Entry 2
<OPTION VALUE="Option 3">Entry 3
<OPTION VALUE="Option 4">Entry 4
<OPTION VALUE="Option 5">Entry 5
</SELECT>
<P>
Text: <INPUT NAME="currentText" TYPE="TEXT" VALUE="">
Value: <INPUT NAME="currentValue" TYPE="TEXT" VALUE="">
<P>
<INPUT TYPE="BUTTON" VALUE="Delete" onClick="deleteOption(this.form)">
<INPUT TYPE="BUTTON" VALUE="Add" onClick="addOption(this.form)">
<INPUT TYPE="BUTTON" VALUE="Replace" onClick="replaceOption(this.form)">
</FORM>
<SCRIPT LANGUAGE="JavaScript">
<!--
onChange(document.formName2);
//-->
</SCRIPT>
?>
<SCRIPT LANGUAGE="JavaScript">
<!--
function onChange(object) {
var Current = object.selectName.selectedIndex;
object.currentText.value = object.selectName.options[Current].text;
object.currentValue.value = object.selectName.options[Current].value;
}
function deleteOption(object) {
var Current = object.selectName.selectedIndex;
object.selectName.options[Current] = null;
}
function addOption(object) {
var defaultSelected = true;
var selected = true;
var optionName = new Option(object.currentText.value, object.currentValue.value, defaultSelected, selected)
var length = object.selectName.length;
object.selectName.options[length] = optionName;
}
function replaceOption(object) {
var Current = object.selectName.selectedIndex;
object.selectName.options[Current].text = object.currentText.value;
object.selectName.options[Current].value = object.currentText.value;
}
//-->
</SCRIPT>
<FORM NAME="formName3" onSubmit="return false;">
<SELECT NAME="selectName" onChange="onChange(this.form)">
<OPTION VALUE="Option 0" SELECTED>Entry 0
<OPTION VALUE="Option 1">Entry 1
<OPTION VALUE="Option 2">Entry 2
<OPTION VALUE="Option 3">Entry 3
<OPTION VALUE="Option 4">Entry 4
<OPTION VALUE="Option 5">Entry 5
</SELECT>
<P>
Text: <INPUT NAME="currentText" TYPE="TEXT" VALUE="">
Value: <INPUT NAME="currentValue" TYPE="TEXT" VALUE="">
<P>
<INPUT TYPE="BUTTON" VALUE="Delete" onClick="deleteOption(this.form)">
<INPUT TYPE="BUTTON" VALUE="Add" onClick="addOption(this.form)">
<INPUT TYPE="BUTTON" VALUE="Replace" onClick="replaceOption(this.form)">
</FORM>
<SCRIPT LANGUAGE="JavaScript">
<!--
onChange(document.formName2);
//-->
</SCRIPT>
?>
Iemand enig idee hoe ik de dropdown (of een andere dropdowncode) kan implementeren in het script?
Gewijzigd op 01/01/1970 01:00:00 door Paul
Gewijzigd op 01/01/1970 01:00:00 door Mr.Ark
Code tags: .
Dit is mijn eerste post!
Gewijzigd op 01/01/1970 01:00:00 door Paul