简体   繁体   中英

Set value and echo “input field”

I want to set value (value="Self_Study") to this input field, I echo this input field as follows

echo '<div class="col-md-4 pull-left hidden self" id="self">
 <input id="' . $SubjectID . '" name="textinput" type="text"  class="input-md tution_provider" placeholder="Self Study" value="Self_Study" disabled>
</div>'

But that value is not echo 图片

how to echo that value ?

Using htmlspecialchars() It nicely worked

echo  '<div class="col-md-4 pull-left hidden self" id="self">
    <input id="' . $SubjectID . '" name="textinput" type="text"  class="input-md tution_provider"  value="' . htmlspecialchars('Self Study') . '" disabled>
    </div>'

试试吧..

echo '<div class="col-md-4 pull-left hidden self" id="self"> <input id="<?php echo $SubjectID; ?>" name="textinput" type="text" class="input-md tution_provider" placeholder="Self Study" value="<?php echo $variable; ?>" disabled> </div>'

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM