From 8c91843b58e7534ea0070357ca53e28d6beb84d2 Mon Sep 17 00:00:00 2001 From: Zachary Sloan Date: Wed, 10 Oct 2012 14:50:23 -0500 Subject: Committing before removing some attempted validation code for the trait data page --- .../static/new/javascript/show_trait.coffee | 26 +++++++++++++++++++--- .../wqflask/static/new/javascript/show_trait.js | 8 +++++-- 2 files changed, 29 insertions(+), 5 deletions(-) diff --git a/wqflask/wqflask/static/new/javascript/show_trait.coffee b/wqflask/wqflask/static/new/javascript/show_trait.coffee index 5e47dedc..9498a1bb 100644 --- a/wqflask/wqflask/static/new/javascript/show_trait.coffee +++ b/wqflask/wqflask/static/new/javascript/show_trait.coffee @@ -237,14 +237,34 @@ $ -> else if $('#block_group').val() == "other" $('#Other_'+index.toString()).find('.trait_value_input').val("x") - $('#remove_samples_field').validate( + $('#block_by_index').click(block_by_index) + + #validate_block_index = -> + # $('#remove_samples_field').valid( + # rules: + # field: + # required: true + # number: true + # messages: + # field: + # "Please check that your input is valid." + # ) + + $('#trait_data_form').validate() + + $('#remove_samples_field').valid( rules: field: required: true number: true - ) + messages: + field: + "Please check that your input is valid." + ) + + #$('#remove_samples_field').change(validate_block_index) + - $('#block_by_index').click(block_by_index) ##End Block Samples By Index Code diff --git a/wqflask/wqflask/static/new/javascript/show_trait.js b/wqflask/wqflask/static/new/javascript/show_trait.js index 7af60fae..5704e183 100644 --- a/wqflask/wqflask/static/new/javascript/show_trait.js +++ b/wqflask/wqflask/static/new/javascript/show_trait.js @@ -280,15 +280,19 @@ } return _results; }; - $('#remove_samples_field').validate({ + $('#block_by_index').click(block_by_index); + $('#trait_data_form').validate(); + $('#remove_samples_field').valid({ rules: { field: { required: true, number: true } + }, + messages: { + field: "Please check that your input is valid." } }); - $('#block_by_index').click(block_by_index); hide_no_value = function() { var _this = this; return $('.value_se').each(function(index, element) { -- cgit v1.2.3