[IMP] Print view: disable inputs

bzr revid: rim@openerp.com-20131227153736-q8wwc523lg5xvi2y
This commit is contained in:
Richard Mathot (OpenERP) 2013-12-27 16:37:36 +01:00
parent 38a245e1fb
commit 4394fde33b
1 changed files with 10 additions and 6 deletions

View File

@ -21,6 +21,16 @@ $(document).ready(function () {
console.debug("[survey] Custom JS for survey is loading...");
var the_form = $('.js_surveyform');
var prefill_controller = the_form.attr("data-prefill");
var validate_controller = the_form.attr("data-validate");
var submit_controller = the_form.attr("data-submit");
// Printing mode: will disable all the controls in the form
if (_.isUndefined(submit_controller)) {
$('.js_surveyform :input').prop('disabled', true);
}
// Custom code for right behavior of radio buttons with comments box
$('.js_comments>input[type="text"]').focusin(function(){
$(this).prev().find('>input').attr("checked","checked");
@ -54,12 +64,6 @@ $(document).ready(function () {
}
});
var the_form = $('.js_surveyform');
var prefill_controller = the_form.attr("data-prefill");
var validate_controller = the_form.attr("data-validate");
var submit_controller = the_form.attr("data-submit");
// Pre-filling of the form with previous answers
function prefill(){
var prefill_def = $.ajax(prefill_controller, {dataType: "json"})