function your_module_search_form($form, $form_state){ $form["title"] = array( "#type" => "textfield", "#required" => true, "#maxlength" => 20, "#attributes" => array('placeholder' => t("Vocabulary, up to 30 letters") , "#title" => t("Vocabulary"), ); $form["item_search"] = array( "#type" => "button", "#value" => t("Search"), ); return $form; }
<div class="input-group"> <input type="text" class="form-control"> <span class="input-group-btn"> <button class="btn btn-default" type="submit">検索</button> </span> </div>
function your_module_search_form($form, $form_state){ $form["title"] = array( "#type" => "textfield", "#required" => true, "#maxlength" => 20, "#attributes" => array('placeholder' => t("Vocabulary, up to 30 letters") , "#title" => t("Vocabulary"), "#prefix" => "<div class='input-group'>", ); $form["item_search"] = array( "#type" => "button", "#value" => t("Search"), "#prefix" => "<span class='input-group-btn' style='vertical-align:bottom;'>", "#suffix" => "</span></div>", ); return $form; }