Last active
December 11, 2015 02:29
-
-
Save bennick/4531291 to your computer and use it in GitHub Desktop.
create action button listner
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/*****************************/ | |
/* Action for Create button */ | |
/*****************************/ | |
$("form#search_form").submit( function(event) { | |
event.preventDefault(); | |
// get word from input form | |
word = $(this).children("input:text").val().toUpperCase(); | |
word_len = word.length; | |
// Fill out group products drop down | |
$('#product_id')[0].selectedIndex = word_len - 1; | |
// Put word as input value to pass to the server | |
$("#name_input").val(word); | |
// Submit the form | |
$('#product_id').trigger("change"); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment