Hide the validation error? - kendo-ui

Here issue is validation is working fine for datetimepickers but while click reset button valaidation is must hide how to do? fiddle:http://jsbin.com/ufimom/167/edit
code
$("#clear").click(function(){
$("#datetimepicker").find("span.k-tooltip").hide();
$("#datetimepicker1").find("span.k-tooltip").hide();
});

Sandeep, Try this..
$("#clear").click(function(){
$("#datetimepicker").siblings("span.k-tooltip-validation").hide();
$("#datetimepicker1").siblings("span.k-tooltip-validation").hide();
});
Its work fine.
jsfiddle http://jsbin.com/ufimom/172/edit

Related

Error: No reCAPTCHA clients exist (reCAPTCHA v3)

I've integrated reCAPTCHA v3 in one of my forms. In onload, there's a token produced and google captcha logo in the bottom right corner. But when I submit the form, in console there is an error shown, "Error: No reCAPTCHA clients exist". Also, it seems, no data is fetched by "g-recaptcha-response" and $_POST["g-recaptcha-response"] remains empty.
Here is the sample code:
<script type="text/javascript">
var ReCaptchaCallbackV3 = function() {
grecaptcha.ready(function() {
grecaptcha.execute("site_key").then(function(token) {
console.log("v3 Token: " + token);
});
});
};
</script>
<script src="https://www.google.com/recaptcha/api.js?onload=ReCaptchaCallbackV3&render=site_key"></script>
It doesn't produce any "g-recaptcha-response" when the form is submitted.
I don't know much about google reCaptcha. I've followed the documentation provided by them and used a site and a secret key in the proper way.
Can anybody please tell me where might be the problem and what is the possible solution?
I believe this error occurs when the reCaptcha api.js loads, but your container is not present on the page yet (at least for v2). I had this error occur in a React app when I navigated to the page rather than loading it as the first on. Instead of using render=explicit and using a global namespace onLoadCallback, I was able to resolve it by rendering the captcha element manually.
Instead of creating a <div class="g-recaptcha"></div>, give the container div an id only (<div id="recaptcha-container"></div>) and render it in your JS code (e.g. in componentDidMount for a React app):
grecaptcha.ready(function() {
grecaptcha.render("recaptcha-container", {
"sitekey": "your-site-key"
});
});
Have you tried loading the script before trying to send the request?
<script src="https://www.google.com/recaptcha/api.js?onload=ReCaptchaCallbackV3&render=site_key"></script>
<script type="text/javascript">
var ReCaptchaCallbackV3 = function() {
grecaptcha.ready(function() {
grecaptcha.execute("site_key").then(function(token) {
console.log("v3 Token: " + token);
});
});
};
</script>
When I came across this problem with reCAPTCHA v3, it was because I didn't pass it the correct site key.
This also happens in Recaptcha 2 before user interacts with it. So, I have a submit button that triggers a JS function that checks the value of recaptcha. To solve the no client exists problem, I did:
try {
data["reCaptcha"] = grecaptcha.getResponse();
} catch (err) {
data["reCaptcha"] = "";
}
The data object then gets sent to a back-end script that validates the recaptcha. The back-end also checks for the field being empty.
I had this problem because I was calling grecaptcha.reset(); when there wasn't any Recaptcha active on the site
grecaptcha.reset();
recaptcha__en.js:507 Uncaught Error: No reCAPTCHA clients exist.
at MX (recaptcha__en.js:507)
at Object.Zn [as reset] (recaptcha__en.js:514)
at <anonymous>:1:13
I was using React and only rendering my captcha container sometimes. Fixed by hiding the captcha button instead of not rendering it.
In my case grecaptcha.reset(); was present from previous code snippet, and I was programmatically invoking it.
As the captcha verification is going on the fly every time. Resetting wasn't required.
After eliminating this grecaptcha.reset(); my code works perfectly fine.
Maybe this hint can help someone.
We received this because we have a second environment with another domain and forgot to add this domain to the reCaptcha admin site. The solution was to add the new domain to the settings.
The steps are
Open www.google/recaptcha/admin/site
Select the site you're working on
Click on the settings gear
Add the domain in its respective section

Uncaught TypeError: t.addEventListener is not a function in hammer.js in chrome browser

I have been using the hammer.js and jquery.hammer.js. In hammer.js i'm getting the addEventListesener error that is in chrome browser.
And the version which i'm using is 1.0.6, both hammer.js and jquery.hammer.js.
If any one faced this kind of error, please let us know it.
thanks
I had this same issue and after some research I figured it out. You need to download the jquery plugin from hammers GitHub.(https://github.com/hammerjs/jquery.hammer.js)
If your using it for a swipe feature you code should look something like this...
$(".element").hammer().on("swiperight", function(){
//code her
});

Desktop notifications allowing not working on chrome

So i want my web page to promt for validation on desktop notifications when it loads. So i added onload in body...
<body onload="setAllowNotification() return false;">
This works jsut fine on mozilla firefox but in Google chrome it doesn't show the question. But if i call that function like this, it works.
<a onclick="setAllowNotification(); return false;" href="#">Click to set allow notifications</a>
If it helps my setAllowNotification function:
function setAllowNotification()
{
window.webkitNotifications.requestPermission(permissionGranted);
}
So any ideas?
Try adding a semicolon to your onload event inline code:
Check this answer actually...
Webkit notifications requestPermission function doesn't work
You can only use it as part of a response to a user action - i.e. you cannot do it "onload"

Add-on sdk : Message passing from contentscript to panel

How can I emit an event from content script to panel add-on script and vice versa? And how can I dynamically update the panel content. Please help. An example in this regard will be greatly helpful for beginners. The basic example given here is not working the example is:
var panel = require("panel").Panel({
contentScript: "self.port.emit('showing', 'panel is showing');"
});
panel.port.on("showing", function(text) {
console.log(text);
});
panel.show();
Nothing is shown in console
This example is given in Add-on SDK tutorial but still it is not working. Any one please Help?
That example works for me. I see the panel and I see the console.log messages.

Chrome extension API: chrome.experimental.clear.* not working?

I made a simple extension that contains a button, that when clicked, executes the following code:
chrome.experimental.clear.cache('everything', function() {
});
but the callback function never seems to get called. Am I using this API wrong or is it just broken?
Here's a link to the API doc for it:
http://code.google.com/chrome/extensions/experimental.clear.html#method-cache
Thanks!
The API has changed to chrome.experimental.browsingData.
I've just landed the documentation updates to go along with the code change: http://code.google.com/chrome/extensions/trunk/experimental.browsingData.html
Here's the most up to date documentation (chrome.browsingData.removeCache):
http://developer.chrome.com/trunk/extensions/browsingData.html#method-removeCache

Resources