Echo Php Variable As An Value Of Input Field
I have a simple HTML form with multiple input tags. On page load i provide data to the form to echo the current value of field from database and than user can modify those values a
Solution 1:
HTML attribute values should generally be wrapped in quotes:
<inputtype="text"name="nameMember"id="nameMember"value="<?phpecho (isset($nameMember)) ? $nameMember: ''?>">
exactly as you already do with the type
and name
attributes
The value
attribute is no different
Solution 2:
Put quotes around your echo
value="<?phpecho (isset($nameMember)) ? $nameMember: ''?>"
Solution 3:
You forget to add quotes in value attribute like value="" in quotes echo your variable ,in HTML quotes generate automatically and if space found attribute automatically close quotes after space
value="<?phpecho (isset($nameMember)) ? $nameMember: ''?>"
Post a Comment for "Echo Php Variable As An Value Of Input Field"