Skip to content

Instantly share code, notes, and snippets.

@eurica
Last active August 29, 2015 14:05
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save eurica/618c704578adacfbbca0 to your computer and use it in GitHub Desktop.
Save eurica/618c704578adacfbbca0 to your computer and use it in GitHub Desktop.
<html>
<head>
<meta name="viewport"
content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no" />
<script src="https://code.jquery.com/jquery-2.1.1.min.js"></script>
<script>
// Step 1. Put the URL from <form action="URL"> here:
var form_url = "https://docs.google.com/a/euri.ca/forms/d/1V6pF3NGpEev0Pl8p22V2fmfHtx-09UtF0bnyAuFoN5E/formResponse"
// Step 2. Put the name from <input type="radio" name="entry.123"> here:
var radio_button_name = "entry.1511256644"
// Step 3. Fill in the options in the divs below:
clickon = function(e) {
me = $(e)
me.addClass( "clicked_on" )
form_data = {}
form_data[radio_button_name]=me.text()
$.post( form_url, form_data, function( data ) {
console.log( data );
}).always(function() {
$(e).removeClass( "clicked_on" )
});
}
</script>
<style>
* {
transition:all .3s ease;
color: #1F293A;
text-align: center;
}
.clicked_on {
background-color:#1962FF;
color: white;
}
.option {
border: 2px solid #1962FF;
padding: 50px 30px;
border-radius: 25px;
font-size: 20pt;
margin: 8px;
}
iframe {
width:100%;
}
</style>
</head>
<body>
<h1>How was the meetup?</h1>
<!-- change these values to be the answers to your survey: -->
<div class="option" onclick="clickon(this)">Great!</div>
<div class="option" onclick="clickon(this)">Too long</div>
<div class="option" onclick="clickon(this)">Too short</div>
<div class="option" onclick="clickon(this)">Not technical enough</div>
<div class="option" onclick="clickon(this)">Too technical</div>
<div class="option" onclick="clickon(this)">Not enough food</div>
</body>
</html>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment