summaryrefslogtreecommitdiff
path: root/views
diff options
context:
space:
mode:
authorgebele <gebele@in-silico.ch>2013-07-03 17:58:10 +0200
committergebele <gebele@in-silico.ch>2013-07-03 17:58:10 +0200
commit016520f61eef52e7344ab91121d53fc2afbf1676 (patch)
tree60c52ad5f68e212b3d4881d93a2b1073ce4a8582 /views
parent8f60b2a316de06cf3878b9fe4ef406bd47bf2ce1 (diff)
minor changes in checkbox function;model titel
Diffstat (limited to 'views')
-rw-r--r--views/predict.haml14
-rw-r--r--views/prediction.haml2
2 files changed, 10 insertions, 6 deletions
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
diff --git a/views/prediction.haml b/views/prediction.haml
index 3fd1586..21d1bfe 100644
--- a/views/prediction.haml
+++ b/views/prediction.haml
@@ -43,7 +43,7 @@
- c = "carcinogen"
%td
%b{:class => "title"}
- = @@prediction_models[count].title
+ = @@prediction_models[count].title.split(" ").first
%br
%br
%b Result: