[英]MVC: How can I make sure that my field have the value selected inside my view on the edit form?
[英]Why can I not edit my form's text field?
我有一個表單,我在Twitter Bootstrap 3中使用。表單將數據發布到mysql數據庫,占位符值從數據庫回顯。 我在'bio'字段中使用了<textarea>
輸入,但由於某種原因,占位符文本在這里表現不同。 我無法刪除光標並像其他字段一樣編輯特定的單詞。 為什么是這樣?
<div class="form-group">
<form class="" action="" id="edit_profile" method="post">
<label>
Name
</label>
<input id="user_name" name="user_name" type="text" placeholder="<?php echo $user_name ; ?>" value="<?php echo $user_name ; ?>" class="form-control input-md" required="">
</div>
Email
</label>
<input id="user_email" name="user_email" type="text" placeholder="<?php echo $user_email; ?>" value="<?php echo $user_email; ?>" class="form-control input-md" required="">
</div>
Bio
</label>
<textarea style="width:100%" value="<?php echo $bio; ?>" placeholder="<?php echo $bio; ?>" name="bio"></textarea>
</div>
<input type="hidden" name="user_id" value="<?php echo $_SESSION['user_session'] ?>">
<button type="submit" class="btn btn-small btn-green pull-right" id="submit">
Save
</button>
</form>
Textarea-text沒有進入value=
它介於<textarea><?php echo $bio; ?></textarea>
<textarea><?php echo $bio; ?></textarea>
標簽。
<textarea placeholder="This is a placeholder">This is the actual text</textarea>
你不能在<textarea>
上有一個value=
因為無論你放在<textarea>
里面的是什么它都會保持不變,因此無論你鍵入什么都不會改變任何東西。 (嘗試刪除示例中的“這是實際文本”)
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.