How to pass data to a field in Google forms - javascript

Question: Is there any way to pass the data from my site to one field in Google Forms?
Example:
I have a web-page where logged user1 is able to interact with other user2. At the end of interaction I want to know the opinion of the user1 about user2.
I want to use Google forms for that. Creating a form with few questions and embedding it on my site is an easy one but I am trying to figure out how to create a field in "Google Form" that will fetch name of user2 from my site/database so I user1 does not have to type it again and again.

Google forms already have such functionality. Follow the steps to create a form and pre-fill any field and/or fields..
Go to Google Drive and Create New Form
Add all the required fields
Click Responses and select Get pre-filled URL
Fill the Values you want to be Pre-filled (At this time the values you enter doesn't matter! You will be able to change it through URL you will get in the next step)
Hit the Submit button! And you will be prompted with the URL
Just Paste the URL in the textEditor and as you can see URL has the values you entered! Just replace them with desired values or generate from the Database your choice!
And you are done! :)
For more help you can visit this link

Related

Recognize form text input email address and send an email without server processing

I am currently studying web development at college and part of my course is to create a website for a mobile company that sells phones and they sell them online.
I'm trying to create a login and signup form but currently struggling to get my form to identify and use the email that the user inputs to send an email to them verifying that they have submitted is it possible and if so any help would be appreciated.
What I will suggest is in your server backend, whether it be PHP, NodeJS, etc
that you register the user in your database and have a boolean value named
'validated' true|false
set default to false, also generate a unique hash and assign it to that user under something like
'validate_hash':gnOOBhgenl2g432noug24g42
Use whatever function your backend server provides (or a library) to generate a unique has, and save this to the newly registered user
Then use a mail function to email the user with a link that will 'verify' them, by adding the unique has to a post url like this:
example.com/register/verify?hash=gnOOBhgenl2g432noug24g42&email=example#mail.com
Obviously you will have to create a script at that location and handles the link and checks the hash value given against the mail provided in the database
If the hash value matches, you can update the users status to
'verified'true
And they can now access services normally.
Majority of this wont need fancy outside libs or complicated coding, just follow what I suggested and google the things I mentioned if you need to figure out a particular element, or comment/msg me!

How to apply password prompt javascript on acrobat pdf

I have a pdf which needs a javascript prompt that would asks for a username and password or just one of these. I have tried the native javascript way inside the javascript editor of acrobat. Alerts work fine but prompts are not working for me.
var customerName = prompt("Please enter your name", "");
have also tried
var customerName = app.prompt("Please enter your name", "");
EDIT:
WEll i tried to remove the complex parts of the process so that you guys can understand better. but i guess i owe you guys some explanation on what i am trying to achieve.
Well i have an empty pdf which i am going to send to my users and when it is opened it will ask for a username/password which is then submitted to my website through an api. I already have an api in place which would check for the correct credentials and on success would print the desired pdf content on a php page, which could be grabbed as a curl request through the javascript inside the empty pdf. And when i want to revoke the access to the user i would just delete the user from the database on my server. So the next time he wants to read the pdf he wont be able to pass through the api security.
Well i know there are some drawbacks on applying so many restrictions like pdf reader compatibility etc. but even if it only works on acrobat that would be fine. Later on will try to remove the print and save options etc.
Most of the parts are done the only thing i am stuck at the moment is on how to send a form GET request to a url. I think js prompt doesn't work in acrobat so i guess i have to send the data through an acrobat form. Any one knows how can i send a get request through the forms or get the values of input boxes in javascript?
Thank you everyone, i just found out on how to post data to a webpage. Here is the link,
Can a PDF fillable form post itself to an HTTPS URL?
Instead of choosing "PDF the complete document" from the format options, choose html.

Storing Javascript object in Wordpress User Database

I am working on a page where user can create his own unique , personalized week schedule.
Right know all about the schedule is stored in javascript object - scheduleArray.
Here is the site with my work so far
How can I store this javascript object to logged user database in WP?
I need to load it from database on site init, and later when user clicks "SUBMIT" button store it back to database.
Could you provide me any ideas, tutorials from which I can start on ?
Thanks!
As one way - add field (maybe something like next https://tommcfarlin.com/add-custom-user-meta-during-registration/) to user profile and store JSON here.
When yser submit form - you can create hidden field with this (by "onsubmit" event) and write to user field by server-side script.

I would like to use Google script to send an email (from a form) to include an accept/reject button

I would like to use Google script to send an email (from a form) to include an accept/reject button.
I currently know how to send an email automatically from an updated form. However, I wish the email to have two buttons which either accept or reject the new form (it's a form for requesting annual company leave).
I can get the email to mention start and end dates, etc., but I don't know how to include buttons.
Thanks in advance.
Gavin.

Pre submission form

I am new to web-building, I am interested in creating a pre-submission form for new users to a gallery / forum for a ghost group. Log their inputs when successful.
What I am trying to achieve is.
When a new user comes to the the landing page, they are asked for their
Username
Age
Referring site code
When they will submit the information, it will check if the username already exists; if they are over 18 and the website code that referred them to the gallery/forum.
I trying to have a members only forum gallery for my ghost group and their friends that are serious. Not to the open public.
I want to have a pre form so that if the general searcher stumbles on the page thay cannnot try to access it.
try looking at some frameworks such as stripes or struts
which will allow you to have form data posted to servlets and having the framework(and/or servlet) perform validation e.g lookig up to see if a record exists, number > 18 etc.

Categories

Resources