From 016520f61eef52e7344ab91121d53fc2afbf1676 Mon Sep 17 00:00:00 2001 From: gebele Date: Wed, 3 Jul 2013 17:58:10 +0200 Subject: minor changes in checkbox function;model titel --- views/predict.haml | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) (limited to 'views/predict.haml') diff --git a/views/predict.haml b/views/predict.haml index 12c3f26..a5e8759 100644 --- a/views/predict.haml +++ b/views/predict.haml @@ -7,11 +7,15 @@ }; return true; }; - //TODO change function for IE; true instead length does not work ! function checkboxes () { - if ($("#model input[type=checkbox]:checked").length < 1 ){ + var checked = false; + $('input[type="checkbox"]').each(function() { + if ($(this).is(":checked")) { + checked = true; + }; + }); + if (checked == false){ alert("Please select an endpoint.") - document.getElementById('model').focus(); return false; }; return true; @@ -70,8 +74,8 @@ #endpoint %b= "Carcinogenicity:" - @models.each do |model| - #model - - model_title = model.title.split(" ").first + - model_title = model.title.split(" ").first + %div{:id => model_title} %input{:type => "checkbox", :name => "selection[#{model_title}]", :id => "selection[#{model_title}]", :value => true, :disabled => false} %label{:for => "selection[#{model_title}]"} = "DSSTox Carcinogenic Potency DBS "+model_title -- cgit v1.2.3