Sending users to different sections of survey - javascript

So I just created a google forms survey and wondered if its possible to send the users to different sections.
I am looking for at way to direct half of the users directly to section 2 and have the other half only see section 1.
User 1: Sees only section 1
User 2: Sees only section 2
User 3: Sees only section 1
and so on
Is there a way to keep a counter in google scripts that that sends the users directly to a section depending on whenever its odd or even without having them answer any questions first?

On the form you can specify that after each of those sections, the form should be submitted instead of continuing on to the next section.
Then, you can get a pre-filled URL for each of the different users by:
Go to the form editor, and on the first page of the form, add a multiple choice question that has each different user as the options.
Then, check the box that says Go to page based on answer.
Next to the multiple choice options for each user, choose Go to page X, depending on which users should go to which sections.
In the menu, go to Responses > Get pre-filled URL.
For each user, select that user from the first multiple choice question and then click Submit.
In the new URL to share the pre-filled form, change viewform? to formResponse? and add &continue=continue to the end of the URL.
Repeat this for each of the different users and then give the users these new URLs for them to fill out the form.

Related

I am trying to do Element Control, Redirection and Form Submission Processing with WIX Code but I am unable to find a suitable method

I'm kind of a beginner to WIX Code. I have this site which I have made i.e www.rat-store.com. I am facing three problems which I know might get solved with some code but I don't know how to do it. Here are the problems:
In manual payment, I need to accept some form input from the user on a page and only if the user agrees to the terms and enters the correct date should the submit button get activated following which an otherwise collapsed image should also reveal (it's the QR code to make payment; Image 1) (www.rat-store.com/manual-pay-rat)
Image 1
I'm trying to link a repeater background to a page but it's not working. I have to create a button inside the repeater to do this. Any workarounds? I know an image will work but the thing is that the motive is to create a kind of a list which will keep on incrementing in the future and I can't just keep on drag-dropping images, text and then group them up and link. (Image 2) (www.rat-store.com/shop-by-events)
Image 2
Since WIX Stores doesn't have an inbuilt cancellation feature I built a form to substitute for the same but I want that no two same order cancellations are submitted i.e. a customer can only submit his/her cancellation request for a particular order number once. The next time s/he tries to do that it should show that the request already exists. (Image 3 and Image 4) (www.rat-store.com/cancel-orders)
Image 3
Image 4
Some help with the code and approach would really be great. I'm almost finished with my site; Only these last few things bother me. I'm attaching a screenshot of each page, serially w.r.t the question number. P.S: The order number is the number generated for each order by the Wix store app itself. I have nothing to do with that. The customer needs to enter his/her number and if that is valid we will process the request. Apologies for the length of the post.

How can I retain like count from a button after a refresh? [duplicate]

I looked on SO, here, a few other places & ... cluelessness set's in.
What is the structure of the Facebook " Like " Button found all over websites ?
Is it a Social Bookmarking, Browser Button kind ?
Is there a step by step process (without using FB Api) to make my own kind of button.
How to design & implement a Like Button ?
I want my own button with similar functionality as FB but NOT related or developed on their platform! I am trying to input this in iWeb'09 as a html widget.
I've done this successfully. Here's how i did it:
You have a table in a database called "likes" with fields username,postid (and date, id if you want too)
Each post/blog/article should have its own id.
When someone likes a post/blog/article, you take the id of the post/blog/article and the username who liked it and check the likes database to see if it already exists. If it already exists, you remove the like. If it does not exist you add a like.
For example with AJAX, this is how i did it specifically:
I have a blog post with id 6.
Jonathan likes this post.
These 2 variables are sent via a post form and wait for a response, likes logic checks database to see if this record already exists in likes table (username,postid) values ('Jonathan', 6) if the response is 1 (or true), then i update the div number for the likes button from whatever value was there originally and add 1. If the response is 0 (or false) then i take the original value in the likes counter and remove 1.
To answer your question consider what happens with buttons and then go into like buttons.
Pressing a button triggers an event on client which may or may not update a server somewhere to notify that a button has been pressed for such and such intention. You can send a lot of extra info with this event like when and where who and why etc
Like buttons usually have extra info on who liked it and what they like. In order to get that you might ask people to sign in or provide some kind of input to identify them.
Take a real world example of a like button you can implement in say javascript using any server side technology
Whoever install your script will be able to see the button. You may form it with any css or your javascript can simply load an iFrame from your server or append elements to DOM to show this button
When clicked it calls your server with person's info or at least the page url where it was called. For example google analytics uses a unique ID associated with domain url to track visitors.
when you recieve this call you can update your database/storage or anything with the tick mark that button on abc site has been pressed so lets update their likes or dislikes.
If you want your javascript can also increment the number on the same page either before or after updating your server.
When someone else visit that site the script again loads and send a request to your server so you can update the count on page but this time user does not click on like/dislike button so you dont update the record.
You may then show it as a pie chart to user on total visits to their site or page with division in people who liked it and people who did not report back (did not press the button)
If you are still wondering how you can create a button . Use CSS button generator to get one
You must first have a database where you can store various values.
Now, Whenever the user clicks the button, the value of the button stored in the database must be incremented. For this, you will need a backend language which connects you to SQL database.
So whenever the button has clicked the value of the likes in the database changes.

jquery history.go() to a specific page after navigating to different pages

I have a scenario where I want to return to a specific page after I navigate to different pages. The scenario is that a user makes a search, gets the results in the same page. He can then make updates on the a specific result on a different page. I would like to create a link that can bring the user back to the search result page. I am trying to user history.go(specificnumber), but how can I get the variable specificnumber from when the user make its first search to the number of page visited or loaded after the search. Or am I in the wrong direction for the implementation?
Maybe I misunderstood your question but if you just want to go to a previous page you can use window.history.back();
Otherwise if you want to save all input data from user (to user) and use it to navigate next you can just use document.cookies or localStorage.

comunicate between 2 windows with javascript

Following problem:
I have one website which contains a huge number of data sheets, another website which contain a form to be filled out. I want to have a third windows, which contains a control script. The control script asks the user to enter the number of a datasheet, it then opens the datasheet from the website, reads the data and fills in the form on the second window. The user checks adds further information and clicks on the form to submit it.
Any idea if this is possible and if it is, how to achieve it ?
I now this is scross site scripting, but in this case it is, was the user needs
Thx a lot for any hint
What about window.postMessage? See: https://developer.mozilla.org/en-US/docs/Web/API/Window.postMessage

Make a form submit() behave like location.replace()

IN SHORT:
There's this web page that needs to be submitted when the user loads the page. There is a good reason for it, long story.
Would it be possible to make a form post submit() behave like a location.replace()? No history trace.
Thanks.
LONG STORY: In my CMS, I have one page for each product. Products are normally listed on section pages, where the user is invited to choose a product :
Small $10 BUY
Medium $20 BUY
Large $30 BUY
Clicking on BUY would send the user to the payment page, off-site.
The product details come from the CMS page, where I defined specific fields for price, product ID, etc. Product detailes are rendered as a form.
I basically don't want to show the independent, permalink product pages, ever. But, this being a CMS, the products will be listed on section pages and whatnot, and the user may end up choosing the products by clicking on a link instead of the full rendered page with the form.
If they do end up on the product page, I want them to be redirected to the purchase page. Of course I don't want to keep the page in history, for the same reasons location.replace() was invented: to avoid the back button of eternal redirection.
Just do an AJAX POST followed by a location.replace. The AJAX POST won't create a browser history entry.

Categories