Jump to content
Search In
  • More options...
Find results that contain...
Find results in...
Advanced Search
  • 0

Hiding form fields


Question

Site URL: https://www.versed-goods.com/shop/do-not-purchase

Hello,

I would like to know if anyone would be able to help me get two form fields to disappear then reappear based on a radio choice. The form that this would happen in can be found on https://www.versed-goods.com/shop/do-not-purchase

What i want to happen is the uploader and the selector would both be hidden on page load, then one would appear based on which radio option you choose.

The code i have has a part where the uploader is hidden, if you run the commented out hide while the form is open in the inspector it will hide the upload field. This should be happening when it opens.

Here is the code i have:

<script>
//when the radio for uploading a product is clicked show the appropriate form field
  $(document).ready(function(){
    //get data
    var window = $('.sqs-modal-lightbox');
    var uploader = $('.sqsf-uploader');
    
    //hide form fields
    uploader.hide();
    //$('.sqsf-uploader').hide();
    // selector.hide();
    
    //add class to file input field
    
      $(document).ready(function(){
          $("input[type='radio']").click(function(){
              var radioValue = $("input[name='radio-yui_3_17_2_1_1595106168164_103612-field']:checked").val();
              if(radioValue == 'yes'){
                  selector.hide();
                  uploader.show();
              } else {
                selector.show();
                uoloader.hide();
              }
          });
      });
  });
</script>

Link to post
  • Answers 0
  • Created
  • Last Reply

Top Posters For This Question

Popular Days

Top Posters For This Question

0 answers to this question

Recommended Posts

There have been no answers to this question yet

Create an account or sign in to comment

You need to be a member in order to leave a comment


×
×
  • Create New...