We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 25312
    • 3 Posts
    So here is what my html looks like:

                <label for="v1primary">Primary Operator</label>
                <select id="v1primary" name="v1primary" class="primarydriver" eform="Primary Operator::0">
    		<option value="Operator 1" selected="selected">Operator 1</option>
    		<option value="Operator 2">Operator 2</option>
                </select>
    


    The catch is, the validation works perfect if I leave the option ’Operator 1’ ’Operator 2’.

    However, I use a bit of jquery to pull the driver names from earlier in the form to change the val/text of each <option>. After the jquery the html looks like this:

    
                <label for="v1primary">Primary Operator</label>
                <select id="v1primary" name="v1primary" class="primarydriver">
    		<option value="Person One " selected="selected">Person One </option>
    		<option value="Person Two ">Person Two </option>
                </select>
            
    


    When I submit the form I now get the error:
    Primary Operator » Incorrect value

    Any thoughts? This is really driving me crazy.

    Thanks,
    Rob
      • 25312
      • 3 Posts
      Edit: Here is the snippet of jquery that acts on the each select box.
      		/* Populate primary driver dropdown. */
      		var primary_ddl = $(".primarydriver");
      		
      		function copyDriver(dnum) {
      			primary_ddl.each(function(){					  
      									  switch (dnum) {
      									  		case 1:
      												var n1 = "";
      												d1.each(function(){ n1 += $(this).val() + " "});
      												$(this).children().eq(0).val($.trim(n1)).text($.trim(n1));
      										  		break;
      												
      											case 2:
      												var n2 = "";
      												d2.each(function(){ n2 += $(this).val() + " "});
      												$(this).children().eq(1).val($.trim(n2)).text($.trim(n2));
      										  		break;
      
      									  }
      									  });
      		}
      		var copyDrivers = function(){ copyDriver(1); copyDriver(2); }
      


      FYI I am passing the copyDrivers function to separate click/blur events.
        • 27023
        • 36 Posts
        Hi ROBP

        Did you manage to resolve this issue, as i’m having the same problem with my jquery in Eforms

        cheers