forked from 18F/micropurchase
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Change published options when changing purchase card
When user chooses 'default' purchase card, he is offered only 'unpublished' choice, whereas when he chooses 'other' purchase card, two options are showed -> 'published' and 'unpublished'
- Loading branch information
1 parent
ddc025b
commit 30f4ad8
Showing
2 changed files
with
15 additions
and
0 deletions.
There are no files selected for viewing
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
$(document).ready(function() { | ||
$("#auction_purchase_card").on("change", function(event) { | ||
published_select_element = $("#auction_published") | ||
|
||
published_option = "<option value='published'>published</option>" | ||
unpublished_option = "<option value='unpublished'>unpublished</option>" | ||
|
||
if(this.value == "default") { | ||
published_select_element.empty().append(unpublished_option) | ||
} else { | ||
published_select_element.empty().append(published_option, unpublished_option) | ||
} | ||
}); | ||
}); |