Check out the LimeSurvey source code on GitHub!
Welcome, Guest
Username: Password:

TOPIC: Validation of array values in dynamic array and compulsory rows

Validation of array values in dynamic array and compulsory rows 3 years 8 months ago #94667

  • kubaj
  • kubaj's Avatar
  • Offline
  • Fresh Lemon
  • Posts: 7
  • Karma: 0
Hi,

I am using previously posted solution for dynamic arrays.
// A function to show subsequent rows of an array as options are checked
		function expandingArray(qID, qQuan) { 
 
// Build an array of the question rows
			var arrayRow = '#question' + qID + ' table.question tbody tr';
 
			// Initially hide all rows unless an input was previously checked
			$( arrayRow ).each(function(i) {
 
				if ( $( arrayRow  + ':eq(' + i + ') input.radio:checked' ).length != 0 ) {
					$( this ).attr('name', 'clickedRow');
				}
				else {
					$( this ).attr('name', 'hidden').hide();
				}
 
			});
 
			// Now show max rows defined by qQuan
			if (qQuan == "") qQuan = 1;
			for (var i = 0; i < qQuan; i++) addRow();
 
 
			// Function to add a row
			function addRow() {
				$( arrayRow + '[name="hidden"]:first' ).attr('name', 'visible').show();
			}		
		}

I haven't found how to set validation using regular expressions for exact (shown rows) in defined column and make also all shown rows compulsory.

Any ideas?
The administrator has disabled public write access.
Time to create page: 0.273 seconds
Imprint                   Privacy policy         General Terms & Conditions         Revocation information and revocation form