-3
I have a Registration/Search Form and now I’m adding the option to edit the fields. To keep the employee from getting confused, I wanted to set the placeholder with a PHP variable, through the echo
. It is possible to do this?
<div class="inputs">
<?php if ($id != '') { ?>
<input type="hidden" name="id" value="<?php echo $id; ?>" />ID: <?php echo $id; ?>
<?php } ?>
<?php echo $cliente; ?>
<input type="text" name="cliente" maxlength="50" placeholder="<?php echo $cliente; ?>" value="<?php echo $cliente; ?>"/><br/>
<input type="text" name="produto" maxlength="25" placeholder="PRODUTO" value="<?php echo $produto; ?>"/><br>
<input type="text" name="solicitante" maxlength="50" placeholder="SOLICITANTE" value="<?php echo $solicitante; ?>"/><br/>
<input type="text" name="status" maxlength="25" placeholder="STATUS" value="<?php echo $status; ?>"/><br/>
<input type="text" name="incluiu" maxlength="25" placeholder="INCLUIU" value="<?php echo $incluiu; ?>"/><br/>
<input id="submit" class="button_text" type="submit" name="submit" value="Cadastrar" />
</div>
Thiago the question is unclear... Want to do this in PHP to be applied to an HTML element? What kind of element is? an input? You can attach an example of the code you have and how it is presented to the official
– Sergio
You either set or pick up the placeholder?
– Franchesco
Sorry for the unclear question, I updated the question with my code, I tried to echo the placeholder but it came out blank.
– Thiago
Earendul, search my bank.
– Thiago
Okay, thank you very much for all the answers ;)
– Thiago
If what you want is a way to reset the value to a previous value, the path is to use the field value and the method reset of the form, or a data-Parameter. (or even Labels even)
– Bacco
I understood, I asked if it was possible to do this and the answer was yes. thank you all for the answers.
– Thiago