How do you insert a value inside an input box from a php file?
for example i have this code
<h1><a>App Test Form</a></h1>
<form id="form_6" class="digitalfuture" method="post" action="#main_body">
<div class="form_description">
<h2>App Test Form</h2>
<p></p>
</div>
<ul >
<li id="li_8" >
<label class="description">Name <span id="required_8" class="required">*</span></label>
<span>
<input id="element_8_1" name= "element_8_1" class="element text" maxlength="255" size="8" value="hello" />
<label>First</label>
</span>
<span>
<input id="element_8_2" name= "element_8_2" class="element text" maxlength="255" size="14" value="" />
<label>Last</label>
</span><p class="guidelines" id="guide_8"><small>Please tell us your name</small></p>
</li>
can anyone point out any tutorials that can help me?
source.php:
input.php:
That will insert the contents of $data into the input field value.
Or did you mean something else?
If you want the text to be visible directly when the page is opened, you can use the html5 feature “placeholder” in the input tag. Like this:
That will show an input field in the page with the text “Write your comment” visible in the field until the user clicks on it and/or writes to the field (no need to delete the placeholder text manually, it disappears automatically).
So when you combine them, it would look like this:
source.php:
input.php: