The Arcive of Official vBulletin Modifications Site.It is not a VB3 engine, just a parsed copy! |
|
#1
|
|||
|
|||
Using <select> dropdown in form - plugin - write to database
I am having difficulty getting this to work.
In the plugin, i have the following code: Code:
$rkc_getchar['name'] = htmlspecialchars($rkc_getchar['name']); $rkc_getchar['class_1'] = htmlspecialchars($rkc_getchar['class_1']); $rkc_getchar['class_1_level'] = htmlspecialchars($rkc_getchar['class_1_level']); ... 'set_name' => TYPE_STR, 'set_class1' => TYPE_STR, 'set_class1_level' => TYPE_UINT, Code:
<input type="text" name="set_name" id="set_name" value="{vb:raw rkc_getchar.name}" class="primary textbox" style="width:75%" /> Code:
<select name="set_class1_level" id="set_class1_level" value="{vb:raw rkc_getchar.class_1_level}" class="primary" style="width:35%"> <option value="1">1</option> <option value="2">2</option> <option value="3">3</option> <option value="4">4</option> <option value="5">5</option> </select> This seems like it should be an easy fix, and it could just be me staring at code for too long, but i cannot seem to get this to work. Any help would be appreciated. EDIT: FEB 01, 2011: OK, it seems that the <select> form IS properly saving to the database, it just does not show up properly when editing. Example, you add an item using the form, and use the name textbox to input "Jimmy", and the <select> to choose number "5", the fields store properly. However, when you go back in to edit that item, it will display "Jimmy" in the text field properly, but the <select> will just show its default value instead of being on "5". How do I fix that? My workaround at this point is adding Code:
Current Level: {vb:raw rkc_getchar.class_1_level} Code:
<option value="">Choose Level</option> |
#2
|
|||
|
|||
I have solved this. Put the <option> in a loop in the plugin and called it.
|
Thread Tools | |
Display Modes | |
|
|
X vBulletin 3.8.12 by vBS Debug Information | |
---|---|
|
|
More Information | |
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|