how to disable HTML textbox focus and that textbox value should submit
Asked Answered
C

2

6

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

Correa answered 6/9, 2012 at 8:55 Comment(0)
C
11

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

Correa answered 7/9, 2012 at 8:38 Comment(0)
I
3

Man, I did this by putting the "onfocus" a function to focus on the next input (then the TAB will function also)

function focarProximo() {
    var tipoSanguineo = window.document.getElementById('tipoSanguineo');
    tipoSanguineo.focus();
}
<input type="text" id="id" name="id" onfocus="focarProximo();">
<br>
<input type="text" id="tipoSanguineo" name="tipoSanguineo" placeholder="Tipo Sanguineo" required="required">
 
Interosculate answered 2/11, 2020 at 5:59 Comment(0)

© 2022 - 2025 — McMap. All rights reserved.