html-input

HTML5 Safari iOS access only camera not photo library

我与影子孤独终老i 提交于 2019-12-04 14:42:47
<input type="file" capture="camera" accept="image/*"> allows a mobile browser to take a picture. On Android native browser and chrome, clicking the input button launches the camera instantly. On iOS Safari, the button launches an alert asking to "Take Photo" or choose from "Photo Library". How can I launch the native camera immediately? It has to do with who is supporting WebRTC . Currently there is no Safari support, partial support from Chrome on Android, experimental support from Firefox for Android. On Android, the default behavior is to use the front facing camera. Future work will allow

Open a color input with display:none via a label (webkit)

孤人 提交于 2019-12-04 13:54:35
I want to hide an input element and trigger it with an associated label . Usually that's not a problem. I can simply set display:none on the input like this input { display: none; } <input id="upload" type="file" /> <label for="upload">Upload a file</label> For some reason in Chrome (Firefox works), this technique is not working for a color input - DEMO input { display: none; } <input id="colorPick" type="color" /> <label for="colorPick">Pick a color</label> Is this a webkit bug or is there a logical reason as to why this doesn't work? I guess it is a bug, for chrome(not really sure about

input field disabled until radio button is checked (HTML)

痴心易碎 提交于 2019-12-03 16:42:29
问题 I have two fields, one of them is a text input field and the other is a select tag. The thing is I want one of them to be enabled only and the user should choose which one is enabled by clicking on one of the radio buttons above. So if the user chooses the first radio button the input field will be enabled and if he choose the second one the select tag will be enabled. Here's my code: <input type="radio" name="type" value="customurl">wanna custom url? <input type="text" name="custom"

Conditionally make input field readonly in Angular 2 or 4: Advice + Best/which way to do it

夙愿已清 提交于 2019-12-03 10:45:16
问题 I was attempting to answer someone elses question. And in doing so realised there was quite a bit of uncertainty in my mind about a few things. I'm hoping someone can provide feedback on the numbered points 1..4: Task: Conditionally make input field readonly Relevant section of HTML: <input type="text" placeholder="Club Name" #clubName> Add this to Typescript component. // class properties @ViewChild('clubName') inp:HTMLInputElement; // Could also use interface Element // conditionally set in

input field disabled until radio button is checked (HTML)

两盒软妹~` 提交于 2019-12-03 06:35:44
I have two fields, one of them is a text input field and the other is a select tag. The thing is I want one of them to be enabled only and the user should choose which one is enabled by clicking on one of the radio buttons above. So if the user chooses the first radio button the input field will be enabled and if he choose the second one the select tag will be enabled. Here's my code: <input type="radio" name="type" value="customurl">wanna custom url? <input type="text" name="custom" placeholder="should be 5 charecters at least" > <br><br> <input type="radio" name="type" value="customurl"

Conditionally make input field readonly in Angular 2 or 4: Advice + Best/which way to do it

走远了吗. 提交于 2019-12-03 01:15:07
I was attempting to answer someone elses question . And in doing so realised there was quite a bit of uncertainty in my mind about a few things. I'm hoping someone can provide feedback on the numbered points 1..4: Task: Conditionally make input field readonly Relevant section of HTML: <input type="text" placeholder="Club Name" #clubName> Add this to Typescript component. // class properties @ViewChild('clubName') inp:HTMLInputElement; // Could also use interface Element // conditionally set in some other methods of class inp.setAttribute('readonly', 'readonly'); inp.removeAttribute('readonly')

Disable only .(DOT) special charecter in input field

耗尽温柔 提交于 2019-12-02 23:37:33
问题 I don't want allow user to enter. (Dot) in my input field.. Rest of the required validation done already. function isNumberKey(evt) { var charCode = (evt.which) ? evt.which : event.keyCode; if (charCode != 46 && charCode > 31 && (charCode < 48 || charCode > 57)) return false; return true; } <input type="text" class="form-control" name="ContactNumber" maxlength="10" value="" id="ContactNumber" title="Enter Number Here" onkeypress="return isNumberKey(event)" required> 回答1: $("#name").on(

Disable only .(DOT) special charecter in input field

被刻印的时光 ゝ 提交于 2019-12-02 13:37:49
I don't want allow user to enter. (Dot) in my input field.. Rest of the required validation done already. function isNumberKey(evt) { var charCode = (evt.which) ? evt.which : event.keyCode; if (charCode != 46 && charCode > 31 && (charCode < 48 || charCode > 57)) return false; return true; } <input type="text" class="form-control" name="ContactNumber" maxlength="10" value="" id="ContactNumber" title="Enter Number Here" onkeypress="return isNumberKey(event)" required> Pratik Galoria $("#name").on("keypress", function(evt) { var keycode = evt.charCode || evt.keyCode; if (keycode == 46) { return

Html regex pattern: [\\d\\s-]{3} works but [\\d-\\s]{3} doesn't. Why?

谁说我不能喝 提交于 2019-12-02 07:25:33
Codepen example: https://codepen.io/Trost/pen/KXBRbY Try putting 1 symbol in both fields. I can't get what's wrong. If I test these regex in https://regex101.com , they appear to be identical. <form> Works: <input type="text" name="country_code" pattern="[\d\s-]{3}" title="-23" required> <input type="submit"> </form> <form> Bug: <input type="text" name="country_code" pattern="[\d-\s]{3}" title="- 3" required> <input type="submit"> </form> The real root cause here is that the regex [\d-\s] is used in the pattern HTML5 attribute, and in the latest versions of Chrome and FireFox is compiled as an

How can I compare date/time values using the jQueryUI datepicker and HTML5 time input?

和自甴很熟 提交于 2019-12-02 05:01:41
问题 I want to validate that the "begin" date/time pair predates the "end" date/time pair on a page. I'm using the jQueryUI datepicker, and the HTML5 time input element/widget. This jQuery: var begD = $.datepicker.parseDate('mm/dd/yy', $('#BeginDate').val()); var endD = $.datepicker.parseDate('mm/dd/yy', $('#EndDate').val()); if (begD > endD) { alert('Begin date must be before End date'); $('#BeginDate').focus(); return false; } (see this script in context here: http://jsfiddle.net/clayshannon