Skip to content

Instantly share code, notes, and snippets.

@tjboudreaux
Created November 4, 2010 04:18
Show Gist options
  • Select an option

  • Save tjboudreaux/662125 to your computer and use it in GitHub Desktop.

Select an option

Save tjboudreaux/662125 to your computer and use it in GitHub Desktop.
uncomment window.location to make it redirect.
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html>
<head>
<meta http-equiv="Content-type" content="text/html; charset=utf-8">
<title>Page Title</title>
<script type="text/javascript" charset="utf-8" src="https://ajax.googleapis.com/ajax/libs/jquery/1.4.3/jquery.min.js"></script>
<script type="text/javascript">
$(document).ready(function(){
$("#event-form").submit(function(){
code = $("#event-code").val();
event_name = $("#event-name").val();
url = 'http://domain.com/events/'+event_name+'/'+code;
alert(url);
//window.location = url;
return false;
});
});
</script>
</head>
<body>
<form id="event-form">
<select id="event-name">
<option value="test">Test</option>
</select>
<input id="event-code" type="text" />
<input type="submit" />
</form>
</body>
</html>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment