php - Pass array values into select option fields within a form? -
This is based in PHP.
Is it possible to take an array like this: And pass those two values in something like this: Where the medical value is being given, and the special public must face. This is the function I use for the actual selection box: And I am selecting this type of: I think I am near, or at least on the right path, I can not figure out how to drag the first ARA value in the value field, then the second real name. The goal is to get the value given in the form, it is different from the public face name I know that the above Aray definition which I have given can not be the right way to do this. Solution Thanks for some responses below Here is the last answer to my problem solving: I have to make sure that my key is unique, so no duplicate will be erased. $ SELECT_INDUSTRY = array ("medicine" => gt; "attribute", "medical" => Specialty "," hair disease "=>" specialty ");
& lt; Select & gt; & Lt; Option value = "$ SELECT_INDUSTRY []" & gt; $ SELECT_INDUSTRY [] & lt; / Options & gt; & Lt; / Select & gt;
$ SELECT_INDUSTRY = array ("medical", "medical", "hair disease"); $ FORM_SELECT_SIZE = 'Input-min'; Function get_options_industry ($ arr = array ()) {global $ FORM_SELECT_SIZE; = "Industry" & gt; Industry & lt; / Label & gt; & Lt; Div class = "controls" & gt; & Lt; Echo to select name & lt; Div class = "control-group" & gt; Label class = "control-label" = "industry" id = "industry" category = "'. $ FORM_SELECT_SIZE." "Gt; & lt; Option value = & gt; Select an industry & lt; / option & gt; 'foreign currency (as the $ AR $ option) {echo' option & gt; $ Option. '& Lt; / option & gt;';} echo '& lt; / select & gt; & lt; / div & gt; & lt; / div & gt;' ;; $ $ FORM_FIELD_INDUSTRY = $ SELECT_INDUSTRY ;
& lt ;? php get_options_industry ($ FORM_FIELD_INDUSTRY)? & Gt;
$ SELECT_INDUSTRY = array ("medicine" => gt; "medical", "medical" =>, "medical", "hair Disease "= & gt;" medical "); $ FORM_SELECT_SIZE = 'input-min'; function get_options_industry ($ arr = array); {global $ FORM_SELECT_SIZE; = "Industry" & gt; Industry & lt; / Label & gt; & Lt; Div class = "controls" & gt; & Lt; Echo to select name & lt; Div class = "control-group" & gt; Label class = "control-label" = "industry" id = "industry" category = "'. $ FORM_SELECT_SIZE." "Gt; & lt; Option value = & gt; Select an industry & lt; / option & gt; 'foreign currency ($ AR $ key = & gt; $ value) {echo' & lt; option value = '' . $ Value. "& Gt; '. $ Key.' & Lt; / option & gt; 'echo' & lt; / select & gt; & lt; / div & gt; & lt; / div & gt; ';;; $ FORM_FIELD_INDUSTRY = $ SELECT_INDUSTRY;
Comments
Post a Comment