I have an HTML form embedded in a .php file. The .php file calls various rows from a database. When this form loads, I used ‘autofocus’ to have the cursor automatically centers in the first text field. How do I have another of the fields automatically load with a variable?
You want to output a value attribute on the inputs e.g.
echo "<input value=\"{$value}\">"
1 Like
Sorry, I don’t want to echo anything to the screen. I want to the text area to autofill with a pulled variable. I attempted what you offered. Didn’t work.
Your said text area. Are you referring to <textarea></textarea>
tags?
If that’s the case, they don’t have a value=“” attribute.
You put the variable between the tags. e.g.
echo '<textarea>' . $value . '</textarea>';
or if not echoing whole line.
<textarea><?php echo $value;?></textarea>
This topic was automatically closed 91 days after the last reply. New replies are no longer allowed.