0 Replies Latest reply on Jul 30, 2007 2:06 PM by Newsgroup_User

    having issue with disable and enable along with validation

    Level 7
      I have a page that asks the question have you worked here before...

      If YES then you select the location you worked..
      If NO then there is no need to make a selection and the drop down is
      disabled..

      I have that working fine.. only issue is.. if they submit the page and
      forgot to answer any fo the required questions the page of course post back
      and displays the error on the field they need to correct or answer.. well
      since the page has been reloaded the field is again disabled.. EVEN if they
      had previously made a selection from the drop down.. with this.. if they
      dont notice it was disabled, they will submit the form and that value will
      not be passed..

      How can i leave the drop enabled IF they make a selection, if no selection
      was made then disabled is fine...here is the code i have currently just for
      that question:

      <label class="bold">Have you worked for US before?</label>
      (if yes, please select location from drop-down)<br>
      <input <%If (CStr(ValidatedField("empapp1","qgrpast")) = CStr("Yes"))
      Then Response.Write("checked=""checked""") : Response.Write("")%>
      type="radio" name="qgrpast" value="Yes" class="radio"
      onClick="document.form1.qgrpastsel.disabled=false">Yes
      <input <%If (CStr(ValidatedField("empapp1","qgrpast")) =
      CStr("No")) Then Response.Write("checked=""checked""") :
      Response.Write("")%> type="radio" name="qgrpast" value="No" class="radio"
      onClick="document.form1.qgrpastsel.disabled=true">No
      <select name="qgrpastsel" id="qgrpastsel" disabled="disabled">
      <option value="" <%If (Not
      isNull(ValidatedField("empapp1","qgrpastsel"))) Then If ("" =
      CStr(ValidatedField("empapp1","qgrpastsel"))) Then
      Response.Write("selected=""selected""") : Response.Write("")%>>Please select
      Location</option>
      <%
      While (NOT rsLocations.EOF)
      %>
      <option
      value="<%=(rsLocations.Fields.Item("StoreNumber").Value)%>" <%If (Not
      isNull(ValidatedField("empapp1","qgrpastsel"))) Then If
      (CStr(rsLocations.Fields.Item("StoreNumber").Value) =
      CStr(ValidatedField("empapp1","qgrpastsel"))) Then
      Response.Write("selected=""selected""") : Response.Write("")%>
      ><%=(rsLocations.Fields.Item("StoreName").Value)%></option>