Willkommen, Gast
Benutzername: Passwort: Angemeldet bleiben:

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

Validation of array values in dynamic array and compulsory rows 1 Jahr 3 Monate her #94667

  • kubaj
  • kubajs Avatar
  • OFFLINE
  • Fresh Lemon
  • Beiträge: 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?
Der Administrator hat öffentliche Schreibrechte deaktiviert.
Moderatoren: ITEd
Ladezeit der Seite: 0.148 Sekunden
Donation Image