Google Forms Prefilled URL Limit (Workaround?) - url

I have a Google Form that I programmatically pre-fill with data (Using Apps Script). I face the problem that, if the URL is too large, the server responses with HTTP Status 400 (Bad Request). The tested URL has 9.000+ characters
Is there a known workaround this issue?
Thanks

It seems that it is not possible GET an infinitely large URL to Google.
A workaround is the following:
Add a checkbox to the form, with only one possible answer.
Programmatically prefill the form with all the field, except checkbox above, and submit() it.
Give your user the Edit Link using FormApp.FormResponse.getEditResponseUrl() (documentation)
Programmatically ignore / delete items that do not have the checkbox checked.
This works because checkboxes with only one value get automatically filled when the form is opened (and submitted) in a browser, but not before.

Related

How can I capture URL parameters sent to a google form, and save them to the connected spreadsheet?

I have 2 scripts - one to fire on open trigger, and one to fire on save, I'm not sure which one would work best with function scope etc...
But basically, users are sent to the survey form using a public link, and additional info is added to that link in the form of parameters/queries, such as:
booking=123456
start-at=1429952400
item=1702
I'm trying to have the script save these parameters, or even the entire URL that was used to open the form, preferably on the same row as the survey response, but even if the user doesn't submit the form, I would still like to save the URL as a non-completed survey (hence the on-open and on-save triggers).
I looked into:
function doGet(e) {},
function URL(text) {},
function doPost(e) {},
even console.log(params); and console.log(e);
as well as others and I cannot seem to get access to the URL.
What gives? Should I just code this on my own server and run my own form? I would really like to figure out google scripting but it seems just too cumbersome at this point. Any help or solution would be highly appreciated.
To be clear, I don't think I can use a pre-filled url, because I don't know that parameter values ahead of time, and I don't think you can use hidden fields for pre-filled anyway.
From the question
What gives? Should I just code this on my own server and run my own form? I would really like to figure out google scripting but it seems just too cumbersome at this point. Any help or solution would be highly appreciated.
To be clear, I don't think I can use a pre-filled url, because I don't know that parameter values ahead of time, and I don't think you can use hidden fields for pre-filled anyway.
A prefilled-url could be used to set the answers to all the questions in a Google Form.
Please bear in mind that Google Forms doesn't support hidden questions in the sense of an HTML form does, the way that you could do this is by putting the question on a section that the form response flow never show it but on the prefill view all the sections are displayed.
Regarding using Google Apps Script to handle Google Forms a custom URL query string that is not supported, so if that is a deal-breaker, then you should use other options.
If you like so much Google Apps Script you could use it to create a web application as doGet pass the URL query string / parameters to the server side code and also you could grab them from the client-side code by using the HTML Service.

Analytics - Where do the parameters come from

Google Analytics provides me a list of called links of my website.
I wonder where these requests came from and what they effect.
e.g.
www.mywebsite.com/subpage/?ls=1
www.mywebsite.com/subpage/?q=keyword
www.mywebsite.com/subpage/?q=13123sdd
What does ?ls=1 and ?q=keyworddo? And where do they came from? Especially the keywords
Those are GET parameters, and most commonly they come as a result of posting forms (or just by clicking on links with such URLs).
For (the most well-known) example, if you go to https://www.google.com and enter "test" and press Enter, you will go to a page http://google.com/search?q=test (with likely a bunch of other parameters as well). In a very simplified scenario, it would be because the box where you input your search string is an input element with name="q" contained in a form element with method="GET" action="/search"; when you submit the form (by pressing Enter), the browser will make the url by adding all the parameter to the form's action like this:
action?param1=value1&param2=value2...
or in this case, /search?q=test.
(In Google's specific case, this is not actually what is happening, because of various kinds of JavaScript magic that is normally going on; but that magic in the end does the same thing. But it could: if you turned off JavaScript on Google, then what I described would be exactly what would happen.)
As I said, you can submit that same URL literally, without having to go through a form. For example, you can click directly on this link to find some kittens: https://google.com/search?q=kittens
Parameters submitted with other methods than GET do not appear in URLs, and cannot be submitted merely by clicking a link, only through forms (which also support POST method) or JavaScript (which can submit any kind of method: GET, POST, or other methods not available to forms or links, like PUT, DELETE...)
As to what they do, nothing by themselves. They are interpreted by the www.mywebsite.com server, in any way they want. In Google's case, q is the query to search from, and what they do is give you (hopefully) relevant results to it. In www.mywebsite.com's case? No idea. Could be anything.

how can i differentiate page load and onclick querystrings in omniture,chartbeat,foresee

I am using currently fiddler and firebug tools to get the requests and responses for my webpage load and click events. I am getting results, but how can differentiate the query string is for page load or for click event.
I want this process for site catalyst, chart beat and for foresee
link click events will at a minimum have a pe query param, which gives the link type. It should have a value like lnk_o or lnk_d or lnk_e. It may also have a pev, pev1 or pev2 query param which specifies the link name if you specified the 3rd argument in your s.tl call. Regular page view calls (s.t calls) do not have either of these parameters.
Grab the firefox extension Omnibug. It will tell you the fired events and distinguish between page load, click and previous page click events. Omnibug will show you the Omniture and GA events but not Foresee or Chartbeat.
I believe the official answer is a Link Track­ing request will have a “pe=” parameter in the image request. Page views will not.

Submit webform via URL only?

I'm not really sure this belongs here, so instead of downvoting just lemme know if so and I'll quickly move it on.
Anyway, there is a website that has a search page, that when hitting the search button it doesn't include the search query in the URL.
After searching for something, the page is redirected to ssearch.asp, but as said, the query isn't there.
My question is if there is a way to submit the search values solely via URL.
I was wondering if there is a way to fake the search-submit button and post the search term
via URL according to form field names.
The name of the input box is search, so I tried this URL: http://www.torec.net/ssearch.asp?search=query, but it doesn't work, the server returns:
server error.
Just to be clear, I'm not looking for a server-side solution, and actually nor for a HTML solution, I just want to be able to paste a plain old URL in my browsers address bar and be there.
Is this possible?
Update
This link doesn't work:
http://www.torec.net/ssearch.asp?search=dark&page=1
While this one does:
http://www.torec.net/ssearch.asp?search=dark&page=2
Any way to bypass this?
Sometimes servers conflate GET and POST parameters, as in PHP $_REQUEST hash. However, normally they are separate - and a server that expects its parameters in multipart/form-data might not look at URL at all. In such a case, as it seems to be here, you have to construct a POST request. On the client side you can do it through AJAX or through constructing and posting a form; on the server side, you can use curl, or a library. You did not say what you want to use it for (and where you want to use it), so you just get the general answer, I'm afraid.
EDIT: Here is the JavaScript semi-solution. You have to already be on some page (i.e. can't use it on _blank), and I'm not sure if it works on all browsers.
javascript:d=document;f=d.createElement("form");h=d.createElement("input");f.setAttribute("method","post");f.setAttribute("enctype","application/x-www-form-urlencoded");f.setAttribute("action","http://www.torec.net/ssearch.asp");h.setAttribute("type","hidden");h.setAttribute("name","search");h.setAttribute("value","query");f.appendChild(h);d.body.appendChild(f);f.submit();
Edit: It is not possible to create a link directly to the first page. However, you can easily send a user to the first page by by creating a form:
<form id="postForm" method="post" action="http://www.example.com/search">
<input type="text" name="search" value="q">
</form>
And then submitting the form whenever the user clicks a psuedo-link:
document.getElementById("postForm").submit();
This can also be done by typing JavaScript code into the address bar:
javascript:a=document.createElement("form");a.method="POST";a.action="http://www.torec.net/‌​ssearch.asp?search=dark&page=2";i=document.createElement("input");i.name="search";i.value="q";a.appendChild(inpu‌​t);a.submit();

openWYSIWYG disabled textarea

Is there anyone here uses openWYSIWYG 1.4.7?
I wanted to display only my textarea by calling
WYSIWYG.display('textarea1');
And I want the text on my textarea not to be selectable that's why I tried this
<textarea1 id=textarea1 name='test1' disabled ></textarea>
but it doesn't work.
Any suggestion?
I doubt if you can prevent selecting the text in text area directly.
You can try placing an element like iframe on top of with with higher Z-index.. so when the user selects what they see as a test area, he will actually be interacting with transparent iframe.
Please keep in mind that any such protection(including the one above) should be not used as a security option. User can always find a way to go select the text or even edit it before submitting it.. they can use web developer plugins like Firebug to do the trick.
Even HTTPS cant prevent this, when the user is itself doing the trick in his browser.
You do your validation in server side, if applicable.

Resources