javascript - Default text in an input field -


i looked everywhere couldn't find useful. need way put default text (preferably php variable) in html text field whenever load page. it's placeholder (i'm aware of placeholder attribute, don't want that) doesn't disappear user can submit value if wants.

i'm guessing can done simple javascript script suck @ that.

thank help.

you're looking value attribute then: value="text here"

with php variable, this:

<form action="path-here">   <input type="text" name="field-name" value="<?php echo $variable; ?>"><br />   <input type="submit" value="submit"> </form> 

Comments

Popular posts from this blog

javascript - Jquery show_hide, what to add in order to make the page scroll to the bottom of the hidden field once button is clicked -

javascript - Highcharts multi-color line -

javascript - Enter key does not work in search box -