Skip to content

Instantly share code, notes, and snippets.

@jonyt
Last active August 29, 2015 14:04
Show Gist options
  • Save jonyt/d31fe32b76d77b30683b to your computer and use it in GitHub Desktop.
Save jonyt/d31fe32b76d77b30683b to your computer and use it in GitHub Desktop.
Boxit widget example usage - radio buttons
<html>
<head>
<title>דוגמא</title>
</head>
<body>
<form>
<label>
<input type="radio" name="optionsRadios" id="radio-mail" value="mail" onclick="handleClick(this);" checked="checked">
דואר
</label>
<br>
<label>
<input type="radio" name="optionsRadios" id="radio-messenger" value="messenger" onclick="handleClick(this);">
שליח
</label>
<br>
<label>
<input type="radio" name="optionsRadios" id="radio-boxit" value="boxit" onclick="handleClick(this);">
לוקר
</label>
<br>
<script type="text/javascript" src="http://www.boxit.co.il/exmp/js/dropdown.js"></script>
<script type="text/javascript">Boxit.create();</script>
<input type="submit" value="הזמן">
</form>
<script>
var dropdown = document.getElementsByName('machine')[0],
cityDropdown = document.getElementById('locker-city'),
mapLink = document.getElementById('map-link');
dropdown.style.visibility = 'hidden';
mapLink.style.visibility = 'hidden';
function handleClick(element) {
if (element.value == 'boxit'){
dropdown.style.visibility = 'visible';
cityDropdown.style.visibility = 'visible';
mapLink.style.visibility = 'visible';
} else {
dropdown.style.visibility = 'hidden';
cityDropdown.style.visibility = 'hidden';
mapLink.style.visibility = 'hidden';
}
}
</script>
</body>
</html>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment