required

Yii2 whenClient validation issue

冷暖自知 提交于 2019-12-11 02:13:54
问题 For some reason I cannot get conditional rule 'required' to work. Even if I reduce the condition to "always return false", required-validation seems to check this unnecessary field: public function rules() { return [ [['order_id', 'product_id', 'quantity'], 'required'], ['product_date', 'required', 'whenClient' => "function(attribute, value) { return false; }" ], // more rules here [['date_create', 'date_update', 'product_date'], 'safe'], // more rules here ]; } On form submit save() fails

Submit a form with jQuery / Javascript without ignoring “required” tag

断了今生、忘了曾经 提交于 2019-12-10 22:02:04
问题 so I have the following form: <form action="register.php" method="post" id="register-form" name="register-form"> <input type="text" id="username" name="username" placeholder="Username" autofocus="autofocus" required /> <input type="text" id="password" name="password" placeholder="Password" required /> <a href="javascript:void(0);" class="btn" onclick="$('#register-form').submit();">Register</a> <input type="submit" style="display: none;" /> </form> What I want to know, is there a way to make

using ETag but the status code is always 200 and not 304

不问归期 提交于 2019-12-10 19:01:17
问题 When I try to request for the the http://graph.facebook.com/me?fields=friends with the ETag I always get the request code as 200 every time. we I made two back to back response and checked it. The change was at the end it had a section for pagination and it attached a access token. which is always different so the ETag value also changes. I am using google app engine to host my app. and using URLFetech to make the request. <code> String ETag = FBUser.getProperty("ETag").toString();<br> String

How to disable submit button AFTER browser has validated fields with 'required' attribute?

烂漫一生 提交于 2019-12-10 18:05:11
问题 We are using the following jQuery to disable submit buttons in order to prevent double submissions (slow server!). jQuery(document).ready(function($){ /*SENDE BTN INAKTIV STELLEN*/ $("input[type=submit]").click(function() { $(this).css({'opacity':'0.5','cursor':'wait'}).attr('disabled','disabled'); }); }); However, how do we fire the script AFTER the browser has validated all fields with the 'required' attribute in our HTML form? 回答1: EDIT: I found a much more elegant way to do this. Please

Html5 form element “required” on iPad/iPhone doesn't work

六月ゝ 毕业季﹏ 提交于 2019-12-10 12:29:58
问题 iPad safari is supposed to be html5 compliant, but it seems that the required element doesn't work. Anyone know why, or have a decent workaround that doesn't require a ton of JavaScript? My code <input type=email class=input placeholder="Email" name="email" required> 回答1: It's not supported in iOS yet: when can I use: required. 回答2: This is a jQuery solution to the issue, it highlights the input fields that have failed in a pinky colour too. $('form').submit(function(){ var required = $('

How to change html5 pattern error messages for email

不想你离开。 提交于 2019-12-10 10:05:04
问题 Html5 required attribute adds normally the error message "Please fill out this field." and it can easily be changed with the following code oninvalid="setCustomValidity('Custom text in another language..')" oninput="setCustomValidity('')" However, I have noticed that when I use inputs with type email I still get messages such as "Please enter a part following '@." and "Please include an '@' in the email address", how can I change them? 回答1: The custom error message comes from the element's

kendo ui, angular require validation for numeric text box

本小妞迷上赌 提交于 2019-12-09 20:19:35
问题 I am trying to use a kendo numeric text box with angular validation (ng-required) however I'm not able to get it working. The ng-required attribute on this element has no effect on the form validation status. From my understanding, the reason why this doesn't work is because kendo numeric text box uses k-ng-model to store it's value, whereas the angular validation works only with ng-model. Has anyone else seen this issue, are there any workarounds? 回答1: I have found a workaround that involves

Required input field gets border when value is empty and color is styled

半腔热情 提交于 2019-12-09 19:14:19
问题 Could you explain me this? Run this in Firefox: http://jsfiddle.net/eMa8y/24/ HTML: <html> <head> <script src="http://code.jquery.com/jquery-1.9.1.min.js"></script> </head> <body> <form> <input type="text" placeholder="input" required /> <input type="text" placeholder="input" /> </form> </body> </html> CSS: input { color:black; } [required] { color:red; } SCRIPT: $(document).ready(function () { setTimeout(function () { $("input").val(""); }, 3000); }); Wait three seconds and the input gets a

Failed to pull image “xx.azurecr.io/xx:latest”: rpc error: code = Unknown desc = Error response from daemon: unauthorized: authentication required

元气小坏坏 提交于 2019-12-08 09:14:37
问题 My ACR and AKS are on same Azure Directory with same subscription. After giving ACR Pull access to my Service Principal, nothing worked and still getting this error. Error :- Failed to pull image "xx.azurecr.io/xx:latest": rpc error: code = Unknown desc = Error response from daemon: Get https://xx.azurecr.io/v2/xx/manifests/latest: unauthorized: authentication required screenshot of dashboard 回答1: From the error message, it shows you do not authenticate to pull the image in your Azure

“alt” attribute on images and “title” attribute on links required in HTML5?

拈花ヽ惹草 提交于 2019-12-07 09:37:00
问题 Me and other developers at our company are struggling with "title" and "alt" attributes. In the past, we added "title"-Tags to all links for SEO purposes (although some of them were annoing talking about usability) and "alt"-Tags on every image on the site, because HTML4 spec said so. Are "title" and "alt"-Tags still required ? If they're not required, do they still have effects on SEO? 回答1: Check the HTML specification to see what is/isn’t required: a element: The (global) title attribute is