How can I make an input field read only but still have it send data back to a form?

后端 未结 7 1299
情书的邮戳
情书的邮戳 2021-01-01 11:22

I have an input field:


相关标签:
7条回答
  • 2021-01-01 12:20

    You should consider using input type="hidden" when submitting read-only fields. Otherwise, if you still need the value of input field to be visible, you should create another input (type=text) with a different name.

    <input cid="Topic_Created" name="Topic.Created" type="hidden" value="6/5/2011 8:22:45 AM" />
    <!--This is visible: -->
    <input cid="Topic_Created" name="doesntmatter" size="25" type="text" value="6/5/2011 8:22:45 AM" />
    
    0 讨论(0)
提交回复
热议问题