how to disable HTML textbox focus and that textbox value should submit

Devendar picture Devendar · Sep 6, 2012 · Viewed 13.1k times · Source

i am working on forms

i used ReadOnly in

Focus is there any data is submitting but not able to edit that textbox data.

i used disabled in no focus is there and no edit but that textbox values is not submitting.

how to solve this issue in my form having

id quantity price Discount Total

ID is autofocus once id is entered Price and Discount Textboxes will fill automatically form DB

when i entered Quantity the next focus should goes to discount - i am not able to do that one please help me on this.

Thanks in advance Devendar

Answer

Devendar picture Devendar · Sep 7, 2012

friends not sure how it works but my problem solved partially i used like this


<input type="text" readonly="readonly" onfocus="this.blur();" />

not used any JS inside of my page but the textbox is not showing in focus

please provide if anything better solutions for this without using JS