Hey All,
It seems like this is a common question... What I have is a dropdown menu that based on the user's selection, I would like it to be able to reply to an already existent thread. Here's my code thus far:
Code:
//ENABLE FORM TO REPLY TO EXISTING THREAD - 1 = yes, 0 = no
$formreply = "1";
$formreplythreadid = "41";
//EXISTING THREAD ID FOR FORM TO REPLY IN
Code:
//////////////////////////////////////////////////////
$dropdownquestion1 = "CLASS";
// The following choices must NOT have quotation marks
$dropdownchoice1a = "Please Select One";
$dropdownchoice1b = "Warrior";
$dropdownchoice1c = "Rogue";
$dropdownchoice1d = "Paladin";
$dropdownchoice1e = "Druid";
$dropdownchoice1f = "Priest";
$dropdownchoice1g = "Mage";
$dropdownchoice1h = "Warlock";
$dropdownchoice1i = "Shaman";
//////////////////////////////////////////////////////
That was from the plugin. All of the variables are properly declared, and the form posts its reply as it should, but only to a staticly set thread.
Here's what I have from my template:
Code:
<tr>
<td class="alt1" valign="middle">
<b>$dropdownquestion1</b>:
</td>
<td class="alt1" valign="middle" colspan="2">
<select name="dropdownanswer1">
<option value="$dropdownchoice1a" <if condition="$dropdownchoice1a == $dropdownanswer1">selected="selected"</if>>$dropdownchoice1a</option>
<option value="$dropdownchoice1b" <if condition="$dropdownchoice1b == $dropdownanswer1">selected="selected"</if>>$dropdownchoice1b</option>
<option value="$dropdownchoice1c" <if condition="$dropdownchoice1c == $dropdownanswer1">selected="selected"</if>>$dropdownchoice1c</option>
<option value="$dropdownchoice1d" <if condition="$dropdownchoice1d == $dropdownanswer1">selected="selected"</if>>$dropdownchoice1d</option>
<option value="$dropdownchoice1e" <if condition="$dropdownchoice1e == $dropdownanswer1">selected="selected"</if>>$dropdownchoice1e</option>
<option value="$dropdownchoice1f" <if condition="$dropdownchoice1f == $dropdownanswer1">selected="selected"</if>>$dropdownchoice1f</option>
<option value="$dropdownchoice1g" <if condition="$dropdownchoice1g == $dropdownanswer1">selected="selected"</if>>$dropdownchoice1g</option>
<option value="$dropdownchoice1h" <if condition="$dropdownchoice1h == $dropdownanswer1">selected="selected"</if>>$dropdownchoice1h</option>
<option value="$dropdownchoice1i" <if condition="$dropdownchoice1i == $dropdownanswer1">selected="selected"</if>>$dropdownchoice1i</option>
</select></td>
</tr>
I have tried putting conditional statements in on the plugin side and am met with "Cannot use a scalar value as an array". I can only assume I am not using array-based variables there properly. Looking at the last snippet of code, where in the option value can I assign "do=form&t=1" based on each selection?
Example: If they select dropdownchoice 1b from here, the corresponding thread that $formreplythreadid would be to 34, 1c would go to 31, so on and so forth.
Any thoughts? Sample code would be great if anyone can provide any