Welcome, Guest
Username: Password: Remember me

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

Validation of array values in dynamic array and compulsory rows 1 year 6 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.
Moderators: ITEd
Time to create page: 0.099 seconds
Donation Image