Universal Form Validator ASP Support Product Page

Validator does not hide fields

Reported 04 Feb 2015 02:29:55
1
has this problem
04 Feb 2015 02:29:55 Fred Muchmore posted:
I have a simple form with a First, Last, Email, Selection list and 3 fields for a serial number. I tried to hide the 3 Registration fields based on a selection. So for instance: Selection 1 hide fields, selection 2 hide fields selection 3 hide the "3" registration fields and finally selection 4 show the "3" registration fields.

I looked at your training video, read what I could spend 4 hours and different types of selections and STILL no way of turn of the fields based on selections. I can get a field hidden however; there is no option to un-hide / show the field once a different selection is selected.


dmxval1.AddRule "Form", "First_Name", "allformats", ",,", "true", "Please Enter Your First Name", "", "", ""
dmxval1.AddRule "Form", "Last_Name", "allformats", ",,", "true", "Please Enter Your Last Name", "", "", ""
dmxval1.AddRule "Form", "Email", "emailcond", ",,", "true", "Please Enter Your Correct Email", "", "", ""
dmxval1.AddRule "Form", "description", "allformats", ",,", "true", "", "", "", ""
dmxval1.AddRule "Form", "Registration_1", "allformats", ",description,== FishFactor CD", "true", "", "", "2", "Reg-1,show,normal"
dmxval1.AddRule "Form", "Registration_1", "allformats", ",description,== BigGameCD70", "true", "", "", "2", "Reg-1,show,normal"
dmxval1.Validate
......................................................................................................................................................................
<!-- ...............Start Of New Form added 2-1-2015 FM ...............................................-->
<!-- Start Of Main Wrapper --> 
<div wrapper id="wrapper">
<!-- Start Of div form -->
 		<div id="form"> 
  <form action="<%=DMX_validateAction%>" method="post" name="Form"  onsubmit="<%=DMX_validateAction%>;;;showMailProgressWindow('blue_mailprogress.htm?<%=Server.UrlEncode(sm1.GetProgressFile())%>',300,100)" id="Form">

<!-- Start Of div First Name --> 
	  <div first_name id="div_firstName"> First Name: 
      
      <!--webbot bot="Validation" s-display-name="First Name" s-data-type="String" b-allow-letters="TRUE" b-value-required="TRUE" -->
      
      <input name="First_Name" type="text" id="First_Name" value="<%= dmxSetValue("", FormRequest("FirstName")) %>" size="32" class="ctrl">
      <%= dmxval1.GenerateError("Form","First_Name","allformats",",,") %></div>
<!-- End of div First Name --> 
<!-- Start Of div Last Name -->     
	 <div last_name id="div_lastName">Last Name: 
      
      <!--webbot bot="Validation" s-display-name="Last Name" s-data-type="String" b-allow-letters="TRUE" b-value-required="TRUE" -->
      
      <input name="Last_Name" type="text" id="Last_Name" value="<%= dmxSetValue("", FormRequest("LastName")) %>" size="32" class="ctrl">
      <%= dmxval1.GenerateError("Form","Last_Name","allformats",",,") %></div>
<!-- End Of div Last Name -->
<!-- Start Of div Email -->
 <div id="Align_text_Email">Email:</div>
	 <div id="Email">
	  

  <!--webbot bot="Validation" s-display-name="Email Address" s-data-type="String" b-allow-letters="TRUE" s-allow-other-chars="@." b-value-required="TRUE" --> 

  <input name="Email" type="text" id="Email" value="<%= dmxSetValue("", FormRequest("Email")) %>" size="32" class="ctrl">
  <%= dmxval1.GenerateError("Form","Email","emailcond",",,") %></div>    
<!-- End Of div Email -->
<!-- Start Of div Registration_1 -->    
	 
     <div id="position-Reg_fields">
     
          <div id="Reg-1">
            Registration Key:
            <!--webbot bot="Validation" s-display-name="Registration Field 1" s-data-type="String" b-allow-digits="TRUE" b-value-required="TRUE" i-minimum-length="2" i-maximum-length="2" --> 
         
            <input name="Registration_1" type="text" id="Registration_1"  value="<%= dmxSetValue("", FormRequest("Registration1")) %>" size="6" maxlength="2" class="ctrl">
            <%= dmxval1.GenerateError("Form","Registration_1","allformats",",description,== BigGameCD70") %><%= dmxval1.GenerateError("Form","Registration_1","allformats",",description,== FishFactor CD") %>&nbsp; </div>
      
<!-- End Of div Registration_1 -->
<!-- Start Of div Registration_2 -->

       <div id="Reg-2"> 
         <!--webbot bot="Validation" s-display-name="Registration Field 2" s-data-type="String" b-allow-digits="TRUE" b-value-required="TRUE" i-minimum-length="5" i-maximum-length="5" -->
         <input name="Registration_2" type="text" class="ctrl" id="Registration_2" value="<%= dmxSetValue("", FormRequest("Registration2")) %>"  size="6" maxlength="5">
         &nbsp;</div>
       
      <!-- End Of div Registration_2 -->
      <!-- Start Of div Registration_3 -->
       <div id="Reg-3"> <!--webbot bot="Validation" s-display-name="Registration Field 3" s-data-type="String" b-allow-digits="TRUE" b-value-required="TRUE" i-minimum-length="4" i-maximum-length="4" -->
         <input name="Registration_3" type="text" class="ctrl" id="t_Registration_3" value="<%= dmxSetValue("", FormRequest("Registration3")) %>"  size="6" maxlength="4">
       </div>
	 </div>
<!-- End Of div Registration_3 -->
<!-- Start Of div Description -->
  	<div  id="Description">
   Product Description.: 
    
    <!--webbot bot="Validation" s-display-name="Product Description" b-value-required="TRUE" b-disallow-first-item="TRUE" -->
    
    <select name="description" class="ctrl" id="description" size="1">
<option <%= dmxSetSelectOption("""",FormRequest("description"),false) %> value="&quot;&quot;">Please Select a Product </option>
<option <%= dmxSetSelectOption("BigGameCD70",FormRequest("select"),false) %> value="BigGameCD70">BigGame CD 7.0</option>
      <option <%= dmxSetSelectOption("COStatewide",FormRequest("select"),false) %> value="COStatewide">CO Statewide Digital Maps</option>
      <option <%= dmxSetSelectOption("WYStatewide",FormRequest("select"),false) %> value="WYStatewide">WY Statewide Digital Maps</option>
      <option <%= dmxSetSelectOption("AZStatewide",FormRequest("select"),false) %> value="AZStatewide">AZ Statewide Digital Maps</option>
      <option <%= dmxSetSelectOption("FishFactor CD",FormRequest("select"),false) %> value="FishFactor CD">FishFactor CD</option>
    </select>
        
    <input type="hidden" name="Register_Reg" id="Register_Reg" value="1">
  	</div>
<!-- End Of div Description -->  
<!-- Start Of div Captcha -->
	<div id="Captchas">
  <p>
    <% 'Small addition to show when reCAPTCHA is incorrect %>
    							<
%							  	if Request.ServerVariables("REQUEST_METHOD") = "POST" then 'if form is submitted
								  If eval("vartype(MM_abortEdit)") = 0 or (Not MM_abortEdit) Then 'and validated
									Response.Write("Valid!")
								  else
								  	Response.Write("<div style=""background-color:red;color:white;"">reCaptcha is not valid! Please try again!</div>")
								  end if
								end if
								%>
			<% dmxval1.ShowBotCheckError() %>
		  </p>
		  <p><%= theCAPTCHA.getControl("white","en") %><br>
		  </p>
	</div>
<!-- End Of div Captcha --> 
<!-- hidden input var fields -->
   <input name="Submit" type="submit" id="Submit" value="Submit Registration">&nbsp;
    <input type="hidden" name="MM_insert" value="Form">
    
    
  </form>
  
  </div><!-- End of Form Div --> 
.....................................................................................................................................................................
<script>
// form fields description structure
var a_fields = {	
	'First Name':{'l':'First Name','r':true,'f':'alpha','t':'First Name'},
	'Last Name':{'l':'Last Name','r':true,'f':'alpha','t':'t_Last Name'},
	'Registration 1':{'l':'Registration 1','r':true,'f':'unsigned','t':'t_Registration 1','mn': 2,'mx': 2 },
	'Registration 2':{'l':'Registration 2','r':true,'f':'unsigned','t':'t_Registration 2','mn': 5,'mx': 5 },
	'Registration 3':{'l':'Registration 3','r':true,'f':'unsigned','t':'t_Registration 3','mn': 4,'mx': 4 },
	'select':{'l':'Product','r':true,'t':'t_select'},
	'Email': {'l':'E-mail','r':true,'f':'email','t':'t_Email'}
},

o_config = {
	'to_disable' : ['Submit', 'Reset'],
	'alert' : 1
}

// validator constructor call
var v = new validator('form1', a_fields, o_config);

</script>

Reply to this topic