Textpattern CMS support forum
You are not logged in. Register | Login | Help
- Topics: Active | Unanswered
Pages: 1
custom field to select multiple
Hi at all.
I have a problem with a custom field.
I use an ob_start(‘buffer’) function to sobstitute a custom field with a select filed with multipleselect option active.
The html code is:
from
<p><label for="custom-3">Inputfile</label><br />
<input type="text" value="" name="custom_3" size="22" class="edit" id="custom-3" /></p>
to
<p><label for="custom-3">Inputfile</label><br />
<select multiple="multiple" size="5" name="custom_3" class="list" id="custom-3">
<option value="5">exe5</option>
<option value="2">exe2</option>
<option value="3">exe3</option>
<option value="4">exe4</option>
<option value="1">exe1</option>
</select></p>
If i choose two or more option and publish/save the article, only the first option selected was saved.
There is a reason for that?
Last edited by MarcoK (2009-07-23 16:52:49)
Offline
Re: custom field to select multiple
no one can help me?
Offline
Re: custom field to select multiple
ok, i foud the errror.
I must insert into name=“custom_3” of the select the array parameter name=“custom_3[]”.
So the function not work however.
It will return me this error
Warning: mysql_real_escape_string() expects parameter 1 to be string, array given in F:\wamp\www\txp\textpattern\lib\txplib_misc.php on line 11
some ideas?
Offline
Re: custom field to select multiple
Instead of replacing the text box can you hide it and then using javascript put the selected values from your select into the textbox for submitting?
Piwik Dashboard, Google Analytics Dashboard, Minibar, Article Image Colorpicker, Admin Datepicker, Admin Google Map, Admin Colorpicker
Offline
Re: custom field to select multiple
glz_custom_fields looks like it has this ability.
Piwik Dashboard, Google Analytics Dashboard, Minibar, Article Image Colorpicker, Admin Datepicker, Admin Google Map, Admin Colorpicker
Offline
Re: custom field to select multiple
MattD wrote:
Instead of replacing the text box can you hide it and then using javascript put the selected values from your select into the textbox for submitting?
yes, i have try width jquery and so, with a esay code ihave obtained this result.
But i ‘m tryng to find a solution without js.
Offline
Pages: 1