Oh no! Where's the JavaScript?
Your Web browser does not have JavaScript enabled or does not support JavaScript. Please enable JavaScript on your Web browser to properly view this Web site, or upgrade to a Web browser that does support JavaScript.
Sign In
Not a member yet? Click here to register.

Form_select let's layout explode

when i add a form_select it is placed outside of the window at the right.
form_text elements are placed as expected.

i added a screenshot and this is the code i use to create:
CodeDownload  

    $item = dbarray(dbquery("select * from " . DB_SF_ITEM . " where id=$id"));
    $output = openform("save_item","POST",clean_request("site=item", array("aid"), TRUE), array("class" => "m-t-20"));
    $output .= form_hidden("id", $item["id"]);
    $output .= form_text("name", "Name", $item["item_name"])."<br>";
    $output .= form_select("type", "Type",$item["item_type"],array("options"=>array(
        1 => $locale["sofu_item_type_1"],
        2 => $locale["sofu_item_type_2"],
        3 => $locale["sofu_item_type_3"],
        4 => $locale["sofu_item_type_4"],
    )))."<br>";
    $output .= form_text("cost", "Cost", $item["item_price"], array("type"=>"number"))."<br>";
    $output .= form_checkbox("active", "Active", $item["item_active"])."<br>";
    $output .= form_button("save_item", "Update", "Update");
    $output .= closeform();
    opentable($locale["sofu_admin_item_edit"]);
    echo $output;
    closetable();

mawe4585 attached the following file:
form_select_placement.png [13.14kB / 110 Downloads]
Add options parameters width

$option = array (
"width"=>"100%" //default is 250px
"required"=>false,
);
Doesn't solve the problem, it only makes the select larger.
However i found out it has something to do with the style-part "display: inline-block"
If i remove this in the developer console it behaves as it should.
it's part of the .select2-container selector in select2.css

have a look at the screenshots
mawe4585 attached the following file:
form_select_display_off.png [27.06kB / 89 Downloads]
form_select_display_on.png [26.65kB / 98 Downloads]
Try adding inline false to options array.
CodeDownload  
"inline" => FALSE

still doesn't work :(
is this display:inline-block really just there because of ie7?
what browsers does php-fusion 9 support? why still ie7?
well it should poof when inline false is used?
if the goal is to make the area smaller you can wrap it in a fixed div with widths specified or ju can try to fall back to smaller amount of PX instead of % based.
im using this in version 9 and it works

Example

CodeDownload  
      echo form_select_tree("figure_manufacturer", $locale['figure_417'], $criteriaArray['figure_manufacturer'], 
         array(
            "inline" => TRUE,
            "required" => TRUE,
            "width" => "400px",
            "placeholder" => $locale['figurelib-placeholder-102'],
            "error_text" => $locale['figurelib-error-102'],
            "no_root" => 1,
            "query" => (multilang_table("FI") ? "WHERE figure_manufacturer_language='".LANGUAGE."'" : ""),
            "maxselect" => 1,
            "allowclear" => TRUE,
         ),

Thread Information
Author
Replies
7 posts
Views
1,945 times
Last Post
Last updated on 3 years ago
You can view all discussion threads in this forum.
You cannot set up a bounty in this discussion thread.
You can start a new discussion thread in this forum.
You cannot reply in this discussion thread.
You cannot start on a poll in this forum.
You cannot upload attachments in this forum.
You can download attachments in this forum.
You cannot up or down-vote on the post in this discussion thread.
Users who participated in discussion: Falk, Catzenjaeger, Chan, mawe4585