Bienvenue, Invité
Nom d'utilisateur : Mot de passe : Se souvenir de moi

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

Validation of array values in dynamic array and compulsory rows il y a 1 an 5 mois #94667

  • kubaj
  • Portrait de kubaj
  • Hors ligne
  • Fresh Lemon
  • Messages : 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?
L'administrateur a désactivé l'accès en écriture pour le public.
Modérateurs: ITEd
Temps de génération de la page : 0.113 secondes
Donation Image