Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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

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

like image 467
Devendar Avatar asked Dec 12 '22 22:12

Devendar


2 Answers

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

like image 67
Devendar Avatar answered May 03 '23 17:05

Devendar


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">
 
like image 25
Luis Guerra Avatar answered May 03 '23 16:05

Luis Guerra