How to call Google translate dropdown on change programmatically - google-translate

I have created simple google translate dropdown for my website used this solution from w3schools https://www.w3schools.com/howto/howto_google_translate.asp this is working fine.
I have tried solution mentioned in the https://www.w3schools.com/howto/howto_google_translate.asp it's working fine Image from my site . Now I want to call the onchange event of this dropdown and call translate api for custom selected language programmatically. please suggest some solution for that Thanks in advance

Related

Does anyone have a working example for serverside datagrid pagination of Clarity?

Does anyone have a working example for serverside datagrid pagination of Clarity?
Please share me a stackblitz or plunker link.
The Clarity website has one such example but here is the full example that you could use. Note it doesn't call a server, but it does the same thing by creating and destroying the array (which happens with an API call).
https://github.com/vmware/clarity/tree/master/src/dev/src/app/datagrid/server-driven

Populate Drop Down List On Google Form Via Google Script

I'm trying to populate a form's drop down list on a google form via a google sheet. I've been looking at the following website and it's been walking me through the process. The issue is that I can't figure out the ID of the drop down list via the "inspect element" feature. I'm using Safari on a Mac. Here's what I see when I highlight the element:
Any idea what the ID would be?
I figured it out. Just in case any one runs into the same issue, the value you're looking for is called data-observe-id. Here's an image of what it looks like:

Custom Google Form? Example of Google Form API?

I'm trying to make a google form look like my own site. I found examples of how to do this on How to style Google Forms and google-custom-form (GitHub project), but I tried both of the examples they give and they seem to fail now.
I had a look at Class Form - Google Apps Script which seems to be like an API, but I can't get my head around the documentation. Does anyone have an example of it working. Or has found another way of getting this to work? It would be really handy to do as embedded forms look really out of sync with the rest of the site.
The API you're linking to is an apps script API. This is needed if you want to create dynamic forms (dynamic amount of questions, dynamic answers,...) but not for custom styling. An intro to appscript can be found on this page: https://developers.google.com/apps-script/
You could just create a form manually on https://www.google.com/forms/about/
You can change the styling and colors in the top-right of the page. When you are ready to embed the form on your own page you have to press "SEND", an select the embed icon <> at the top.
I've worked with this a ton, and still have issues with it. Been learning the new api v4 for sheets but still having trouble, it is still in beta too. For now I can recommend this solution though by heaversm on github.
https://github.com/heaversm/google-custom-form
The example fully works as long as you find the entry.xxxxxxx for each field and replace in the appropriate js. To avoid the embed issues, give your form submit on a click function that has the event as the input and then preventDefault on the event like so:
$('#submit-button').on('click', function(event){
event.preventDefault();
// continue code from heaversm
});
Hope this works for you. Cheers

Is there a way to edit css of new google forms?

Before I used to be able to just copy the source code of the form and paste the part between <form></form> into the page and add my own styling. But this doesn't seem to work anymore.
Has anyone found a way to still be able to customize google forms?
Yes, you can easily make the <form> work by following these steps.
Create a Google Form.
Get the link and open the form in a new tab.
Create a barebone form having same items as the Google form.
Inspect Google form for action attribute.
a. Copy the same action to your form.
Inspect and find values for attributes name in the Google form.
a. Give the same name values for your form items as well. The values look like entry.742532386.
Check if your form gets the responses.
Since it is a native <form> element, apply CSS however you want to.
Read more here
Google forms does not currently (mar-2021) have a built in feature to add css or javascript to their forms.
I created this GitHub project to work around the problem: https://github.com/calledit/google_form_javascript_css

Google map in wordpress

I want to make web site like this.
http://sf.eater.com/maps/the-38-essential-san-francisco-restaurants-january-2015
I don't have any experience Google map API.
Where I can get sample code or theme like this?
Google map api is pretty simple, but you need to use some other plugins as well to make it work like this website. Although i wont be able to handover the code to you, but here is what you have to do.
You just create a map and add points to a map and then add an event on the click. Take a look at this for a simple event.
https://developers.google.com/maps/documentation/javascript/examples/event-simple
You can replace the zoom in feature with windows load method to jump to a certain anchor on a page. You can also add any smooth scrolling plugin, You can use this code.
https://css-tricks.com/snippets/jquery/smooth-scrolling/.
Now when someone clicks on the map, javascript should be redirecting you to another page but because you will be using this technique with #anchors, instead of going to another page it will try to find this anochor on the same page. And the smooth scroll plugin will animate the scrolling for a better effect.

Resources