select widget

Archived from the Xataface Users forum.

pie — Thu Oct 27, 2011 12:14 pm

Hello

two little questions:

  1. Is it possible to remove the “please select” from a select widget so that it just gives the options?

  2. is it possible to put a select widget in the navigation pane?

kind regards
P


ADobkin — Thu Oct 27, 2011 8:21 pm

pie wrote:1. Is it possible to remove the “please select” from a select widget so that it just gives the options?

You would have to modify the source to Xataface to do this. Refer to the file ./Dataface/FormTool/select.php, lines 17-18. I am not sure what all the repercussions would be without testing it. If you modify this file directly, it will affect all select widgets in your installation. You could try duplicating this file to roll your own separate select widget and then referencing which one you need. Or, if you have PHP coding skills, you could make it an optional parameter that could be configured on a per-field basis in fields.ini. If you do this, please consider sharing your results here.

pie wrote:2. is it possible to put a select widget in the navigation pane?

This would probably also require some customization and creative coding skills.


shannah — Fri Oct 28, 2011 9:22 am

You could also just set a default value for that field. The “please select…” option would then still be there, but it wouldn’t be selected by default so most people wouldn’t notice it.


shannah — Fri Oct 28, 2011 9:22 am

Alternatively you could use javascript to remove this option on page load.


pie — Wed Nov 02, 2011 1:35 am

Shannah, how do I set a default value for that field?


ADobkin — Wed Nov 02, 2011 4:16 am

pie wrote:how do I set a default value for that field?

It is specified in MySQL, along with the data type for that column.