disabled-input

How to disable an input field using Javascript?

两盒软妹~` 提交于 2019-12-04 16:24:14
问题 I'm starting with Javascript, I wrote this function: function disableField() { if( document.getElementById("valorFinal").length > 0 ) ) { document.getElementById("cantidadCopias").disabled = true; } } Which disables the second field named cantidadCopias if the first one is filled. <label> <span>Valor final:</span> <input type="text" class="input_text" name="valorFinal" id="valorFinal" onkeydown="disableField()"/> </label> <label> <span>Cantidad de Copias:</span> <input type="text" class=

How to make a greyed-out HTML form?

不问归期 提交于 2019-12-04 10:29:49
问题 I'd like to have a group of HTML text <input> 's that can be all greyed-out (disabled) at the same time. I also want the entire area they are in to somehow be greyed-out or at least visibly disabled. I've seen things like this done in desktop applications. Any ideas on an easy/elegant way to do it? I'm trying to avoid manually setting each to disabled="disabled" , and also have an area surrounding the <input> 's that indicates that entire portion of the form is non-editable. EDIT: Sorry, I

Texbox input, disable for keyboard, keep for barcode scanner

坚强是说给别人听的谎言 提交于 2019-12-04 05:41:47
问题 I have made a Windows Form application with a textbox. I will force users to use the barcode scanner, so the keyboard input should be disabled. The KeyPressed event does not work, because is also disabled input from the barcode scanner. I thought maybe I can set a timer on the TextChanged event, but I do not really know how it works. Have someone a good idea? 回答1: Based on your description, I assume that your barcode scanner is an HID barcode scanner. If so, there is no easy answer here

Disabled Text Input with onclick

与世无争的帅哥 提交于 2019-12-04 03:43:43
问题 I need a way of capturing onclick, for a text input that is disabled. I would prefer not to use jQuery, but if there was no javascript alternative, would use it. Thanks in advance EDIT: I have tried simply adding an onclick="" to a disabled text field, which did not work. Is there any way to do it without jquery? Thanks 回答1: How about delegation events to parent elements like here? <span style="position:relative;" onClick="event.target.value='clicked';"> <input type="text" disabled "/> </span

Fieldset and disabling all child inputs - Work around for IE

 ̄綄美尐妖づ 提交于 2019-12-03 10:56:35
I have a fieldset that has a ui-view under it. Each view had lots of fields(a field is a directive that wraps an input) under it. It looks something like this: <fieldset ng-disabled='myCondition'> <div ui-view></div> // this changes with lot's of fields that look like <div field='text-box'></div> </fieldset> Now, this worked great, the fields get disabled on all browsers except IE . I've done some google and seen that ie doesn't support fieldset + disabled and I'm looking for a quick workaround. I've tried some things that were close but not perfect and I assume I'm not the first one that

How to make a greyed-out HTML form?

杀马特。学长 韩版系。学妹 提交于 2019-12-03 06:06:10
I'd like to have a group of HTML text <input> 's that can be all greyed-out (disabled) at the same time. I also want the entire area they are in to somehow be greyed-out or at least visibly disabled. I've seen things like this done in desktop applications. Any ideas on an easy/elegant way to do it? I'm trying to avoid manually setting each to disabled="disabled" , and also have an area surrounding the <input> 's that indicates that entire portion of the form is non-editable. EDIT: Sorry, I should mention a few more things... Everything is local. I'm not using PHP or ASP or anything like that..

Form validation for dynamic table tr angular 5

回眸只為那壹抹淺笑 提交于 2019-12-02 19:32:50
问题 I have dynamic table tr and each row contains a submit button. I also applied input control name dynamically. What is the best way to enable/ disable button based on the tr row validation? <form #form1="ngForm"> <table> <thead><tr><th>Name</th><th>Email</th><th>Action</th></tr></thead> <tbody> <tr *ngFor="let value of data; let i=index"> <td><input type="text" name="name{{i}}" #nameInput="ngModel" [(ngModel)]="dataModel.name" [value]="value.name" required /></td> <td><input type="text" name=

Form validation for dynamic table tr angular 5

余生长醉 提交于 2019-12-02 11:27:04
I have dynamic table tr and each row contains a submit button. I also applied input control name dynamically. What is the best way to enable/ disable button based on the tr row validation? <form #form1="ngForm"> <table> <thead><tr><th>Name</th><th>Email</th><th>Action</th></tr></thead> <tbody> <tr *ngFor="let value of data; let i=index"> <td><input type="text" name="name{{i}}" #nameInput="ngModel" [(ngModel)]="dataModel.name" [value]="value.name" required /></td> <td><input type="text" name="email{{i}}" #emailInput="ngModel" [(ngModel)]="dataModel.email" [value]="value.email" required /></td>

vertical scrolling of disabled <select> mutliple element not working in IE

六眼飞鱼酱① 提交于 2019-12-02 00:00:49
I have a select multiple element with scrollbars that is disabled. In Chrome and Firefox on Windows it is still scrollable but no selections can be made. However in IE its not scrollable, so not all options can be seen. Is there any way to force IE to behave like Chrome/FF in the same way? This is basically a read-only presentation of the multi-select picklist where they can see which elements where selected. Here's some example code and a fiddle ( http://jsfiddle.net/2ET44/2/ : <select multiple size="5" style="max-height:50px" disabled> <option>value number 1</option> <option>val 2</option>

Disabled Text Input with onclick

…衆ロ難τιáo~ 提交于 2019-12-01 19:50:43
I need a way of capturing onclick, for a text input that is disabled. I would prefer not to use jQuery, but if there was no javascript alternative, would use it. Thanks in advance EDIT: I have tried simply adding an onclick="" to a disabled text field, which did not work. Is there any way to do it without jquery? Thanks How about delegation events to parent elements like here ? <span style="position:relative;" onClick="event.target.value='clicked';"> <input type="text" disabled "/> </span> If my answer is acceptable please comment it and I'll make an explanation. You are probably lookinf for