Tuesday 15 July 2014

how to pass php string code to html -


I have a function that gives me the selected drop down value which is clearly coming from DB. The problem here is that the HTML in my drop down is present in PHP tags

    

The problem is that it does not pay me back any value, and I am confused now how can I enter the php string value in this html .. I want Dropdown value is selected. Please help me with this problem.

I have set your code slightly, can work:

 < Code> & lt ;? Php function _callback_request_type ($ value, $ primary_key) {$ q = (! Empty ($ value))? "Selected = selected": ""; Return '& lt; Select name = "request_type" id = "request_type" & gt; & Lt; Option value = "" & gt; Request type & lt; / Options & gt; & Lt; Option value = "Housing" '. (($ Value == "Accommodation")? "Selected = Selected": ""). ' & Gt; Housing & lt; / Options & gt; & Lt; Option value = "Employment" & gt; Employment & lt; / Options & gt; & Lt; Option value = "education" & gt; Education & lt; / Options & gt; & Lt; Option value = "finance" & gt; Finance & lt; / Options & gt; & Lt; Option value = "Wellness" & gt; Wellness & lt; / Options & gt; & Lt; Option value = "Other" & gt; Other & lt; / Options & gt; & Lt; / Select & gt; '; } Echo _callback_request_type ("housing", void); // echos need stuff? & Gt;    

No comments:

Post a Comment