How could I show reCAPTCHA before a page loads, like it shows the reCAPTCHA when a user visits the page and they need to fill out the reCAPTCHA then if they successfully filled out the reCAPTCHA it'd load the pages contents.
You can't do that, you will need to add an extra step in between.
You can add a page that says something like
Click here if you are a human
And then put your recaptcha validation in a button where the user responds
Sorry you don't that. When a webpage load first execute your server side language then client side language. You add ajax system.
You can hide/disable your page content untill user verify captcha process, also visit this for an idea,
How can I validate google reCAPTCHA v2 using javascript/jQuery?
Related
I try to describe this problem as clear as possible.
I have an application where there is a form with some switches.
When i submit this form, the form will update an XML file with the new information.
After submitting that information, the website needs to target a page just to run, not to visit.
Example:
window.open("http://user:alarm#10.2.2.5/reload/functions.php");
The only problem here is that:
1. It doesnt run the script because the page reloads automaticly when submitting the form.
2. The user of the website visits the page, but it only needs to be run.
Someone know an fix for this?
Best Regards,
Kris
I am trying to create a login and register page.
This is the form. Suppose if I am click on ABOUT US page and return to login page (click back button), the content of this page showing like this..
My requirement is, If I am return to login page (from ABOUT US), the label should be in the top of the Mail Id (look in 1st image). Password is ok. Because we need to type again.
here is my code fiddle.. fiddle.jshell.net/1nmmcj80/
According to your jsfiddle, $ is not defined. It seems like you're trying to use jQuery, while it's not loaded. By loading jQuery your fiddle worked perfectly fine.
So the fix would be to load jQuery before your script.
I have a PHP script (download.php) that receives Form Post data from the index.php page.
The processing takes a while to submit the form thus making the browser loading (the spinning wheel) for quite some long time.
Can I force the browser not to show the gray loading wheel until the form is submitted and the Post page (download.php) is done and ready to display?
For example like Youtube is doing now, they show a progress bar on top but the browser is not loading at all.
To achieve an effect similar to youtube you would need to use AJAX in conjunction with the history.pushState();.
Youtube has released a framework called spfjs for achieving the same effect that their own website has. Take a look at https://youtube.github.io/spfjs/.
If you click submit button and move to download.php, the web browzer will definitely show a loading tab. To avoid this, AJAX can be used.
Once the form data are submitted by means of AJAX, you can also receive back the download.php page contents ready to be displayed using the same AjAX response. Then hide the contents of index.php and place the received html instead. I hope it will work, for I am using this method.
Thank you.
I am planning to create some dynamic content in a Facebook tab for my fan page. It should have content displayed if the visitor is not a fan, and then upon them clicking the Like button, changing the content to display hidden carrots (metaphorically). Is it possible to capture the event of the click on the Like button from inside the iframe?
On a Facebook fan page, when the user clicks the Like button, the whole page gets reloaded and Facebook sends an HTTP post to your website with a parameter called signed_request that you would need to decode and look at with server code, not javascript. The code to decode it will obviously vary depending on what language you are using, but the process is documented on Facebooks site. Once decoded, you will need to look at the page.liked value.
Am doing the online cab booking services,
once user reached the successfully completed his journey,
we are showing the thank for booking and we show the booking id, some people they hit the F5
key, so page get refresh and the new entry will inserted ,
So i want to deactivate F% on my cashthankyou you page,
Thanks
Bharanikumar
You won't have much luck with this - control / detection of key presses is heavily browser dependant, and overriding standard behaviour is usually impossible.
Rather than this approach, you need to detect and appropriately handle duplicate form submission:
How to handle multiple submissions server-side
The best option is usually to find a way that don't involves tampering with browser functionality. In your case, that would be making the user submit the booking to a page that inserts the entry, and then redirects the user to a thankyou-page that does nothing more than displaying that. The user would then be able to refresh the page any amount of times, without anything dangerous happening.
You can't. This is in how the browser is coded and you can't disable it from the webpage.
You need to restructure your application to identify a refresh of this kind and not creat an additional record.
One way to do that is to check if a record was entered for the user just several seconds ago and if that is the case, not insert a new record.
Another way it to add an interstitial page that will do the adding then redirect to your confirmation page (this page is just a display page and refreshing it won't do anything).
I dont't know if you can disable the F5 but can display some kind of "are you sure" message.
This can be done using window.onbeforeunload which is called before the window reloads or gets closed.
There could be a couple of reasons they refresh the page. Maye they used their back button, double-clicked on your submit button or anything else that does the loading twice.
Here are two real solutions to your problem:
1) Put in a form field with a random number, save this number along with the booking and then check against your booking table if there already are a booking with that value. This will stop them from sending the form twice.
2) Save a cookie with the last time they completed a booking. Check this value and don't allow a new booking for i.e. five minutes.
An alternative would be to redirect your user to the thank you page, loading the ID from the session.
This way, when the user hits F5 the thank you page will load and no form submission will be attempted again.
If no booking ID is in the session when the thank you page is loading, redirect back to the home page or a suitable error page.