Forum Replies Created

Viewing 12 replies - 1 through 12 (of 12 total)
  • Thread Starter yourtrustedfreelancer

    (@yourtrustedfreelancer)

    Hi,
    It seems it is still not clear what my issue is. What I am trying to accomplish is sending the auto generated password inside the email notification when a user registers, I tried adding a hidden not required password field but that didn’t work.
    The solution is to add an auto generated password tag in the email notification content so the new user knows what the password is for his/her account.

    Thanks

    Thread Starter yourtrustedfreelancer

    (@yourtrustedfreelancer)

    Hey, thanks for replying.
    I did what you suggested but I don’t see how the auto generated password will be sent via the email.
    If I place the password field and set the password as “password-1” the form won’t be submitted unless that field is filled, and if I set auto generated password, the password won’t be sent since “password-1” is empty.
    The only workaround I found is to cancel the email to client by the form and use the WordPress activation email and edit its content.
    Thanks again, I hope this issue will be resolved in future updates, your plugin is one the best form plugins.

    Thread Starter yourtrustedfreelancer

    (@yourtrustedfreelancer)

    Either from LiteSpeed Cache -> General -> Server IP
    or from your quic dashboard -> you domain -> settings -> server IP.

    Thread Starter yourtrustedfreelancer

    (@yourtrustedfreelancer)

    I have found the issue, I needed to update the IP address for the server
    Thanks.

    Thread Starter yourtrustedfreelancer

    (@yourtrustedfreelancer)

    Thanks for replying,
    I have done that many times. And even Destroy All Optimization Data but still nothing.
    I also done upon your request and nothing was pulled after 5 min.

    yourtrustedfreelancer

    (@yourtrustedfreelancer)

    Hi @1alejandros , Can you please match the stars rating to your review, this is the only 1 star rating and your review says you love it ( as everyone else ).

    Thread Starter yourtrustedfreelancer

    (@yourtrustedfreelancer)

    Hello,
    Thank you so much much for this, you are a true hero.
    I thought I was close but this would have taken me months before I figured it out – I have read the comments πŸ™‚ and added

    // Remove any value in post object 2 in case user changes the post object 1 selection.
                $post_object_2_input.val(false);
                $post_object_2_input.change();

    for post object 1 on change.
    The code works perfectly back-end and somehow front-end, the result

    Is it possible – using that code – to add it to the plugin? at least for the post object fields, maybe – just like the bidirectional or conditional logic – as options, let’s say you could add:

    $post_objct_1_field_name = get_field('post_object_1', options);
     $post_objct_2_field_name = get_field('post_object_2', options);
     $args 	                  = get_field('post_object_2_args', options);

    then a user can choose in post object 2 the related post object 1 and the args to query the post object 2, but I leave it to you , you are the expert :).

    Again, Many thanks, and I will always support this plugin and your work.

    Hi, this is probably a late answer, but I was playing around and trying to figure how we could create a multi-step form and this is what I came up with.
    First override form HTML render and add this code:

    <!-- Circles which indicates the steps of the form: -->
      <div style="text-align:center;margin-top:40px;">
        <span class="step"></span>
        <span class="step"></span>
      </div>
    <!-- Tabs are the steps of the form: -->
    <div class="tab"> <p>{field:field_key}</p><p>{field:field_key}</p></div>
    <div class="tab"> <p>{field:field_key}</p><p>{field:field_key}</p><p>{field:field_key}</p></div>
    
     <div style="overflow:auto;">
        <div style="float:right;">
          <button type="button"  id="prevBtn" onclick="nextPrev(-1)">Previous</button>
          <button type="button"  id="nextBtn" onclick="nextPrev(1)">Next</button>	
     </div>
    
    <script>
    var currentTab = 0; // Current tab is set to be the first tab (0)
    showTab(currentTab); // Display the current tab
    
    function showTab(n) {
      // This function will display the specified tab of the form...
      var x = document.getElementsByClassName("tab");
      x[n].style.display = "block";
      //... and fix the Previous/Next buttons:
      if (n == 0) {
        document.getElementById("prevBtn").style.display = "none";
    				document.getElementById("subBtn").style.display = "none";
    
      } else {
        document.getElementById("prevBtn").style.display = "inline";
      }
      if (n == (x.length - 1)) {
        document.getElementById("nextBtn").style.display = "none";
    				document.getElementById("subBtn").style.display = "inline";	
      } else {
        document.getElementById("nextBtn").style.display = "inline";
      }
      //... and run a function that will display the correct step indicator:
      fixStepIndicator(n)
    }
    
    function nextPrev(n) {
      // This function will figure out which tab to display
      var x = document.getElementsByClassName("tab");
      // Exit the function if any field in the current tab is invalid:
      if (n == 1 && !validateForm()) return false;
      // Hide the current tab:
      x[currentTab].style.display = "none";
      // Increase or decrease the current tab by 1:
      currentTab = currentTab + n;
      // if you have reached the end of the form...
      if (currentTab >= x.length) {
        // ... the form gets submitted:
        document.getElementById("testForm").submit();
        return false;
      }
      // Otherwise, display the correct tab:
      showTab(currentTab);
    }
    
    function validateForm() {
      // This function deals with validation of the form fields
      var x, y, i, valid = true;
      x = document.getElementsByClassName("tab");
      y = x[currentTab].getElementsByTagName("input");
      // A loop that checks every input field in the current tab:
      for (i = 0; i < y.length; i++) {
        // If a field is empty...
        if (y[i].value == "") {
          // add an "invalid" class to the field:
          y[i].className += " invalid";
          // and set the current valid status to false
          valid = false;
        }
      }
      // If the valid status is true, mark the step as finished and valid:
      if (valid) {
        document.getElementsByClassName("step")[currentTab].className += " finish";
      }
      return valid; // return the valid status
    }
    
    function fixStepIndicator(n) {
      // This function removes the "active" class of all steps...
      var i, x = document.getElementsByClassName("step");
      for (i = 0; i < x.length; i++) {
        x[i].className = x[i].className.replace(" active", "");
      }
      //... and adds the "active" class on the current step:
      x[n].className += " active";
    }
    </script>

    give an id to submit button
    <input type="submit" id="subBtn" value="%s"/>

    and add the css styles:

    		/* Hide all steps by default: */
    .tab {
      display: none;
    }
    
    				/* Make circles that indicate the steps of the form: */
    .step {
      height: 15px;
      width: 15px;
      margin: 0 2px;
      background-color: #bbbbbb;
      border: none;  
      border-radius: 50%;
      display: inline-block;
      opacity: 0.5;
    }
    
    .step.active {
      opacity: 1;
    }
    
    /* Mark the steps that are finished and valid: */
    .step.finish {
      background-color: #4CAF50;
    }
    
    input.invalid{
      background-color: #ffdddd;
    }
    #subBtn{
    	display:none;
    	float:right;
    	margin-top:10px;
    }

    Reference: w3schools
    I hope this helps someone πŸ™‚

    Thread Starter yourtrustedfreelancer

    (@yourtrustedfreelancer)

    Hi,
    Thanks for the reply,

    I was finally able to save the submitted value using this code:

    add_action('woocommerce_checkout_update_order_meta', 'checkout_date_time_field_update_order_meta');
    function checkout_date_time_field_update_order_meta( $order_id ) {
    			$field_name = 'date_time_1';
    			$field_value = $_POST['acf']['field_5e9b33aa85f9c'];
         if ( ! empty( $field_value ) ) {
           	 	update_post_meta( $order_id, $field_name , $field_value );
        }

    this will also work using update_field( $field_name, $field_value, $order_id); instead of update_post_meta

    I needed to use $_POST['acf']['field_key'] in order to get the submitted value.
    I hope this helps someone too.
    Many Thanks.

    Thread Starter yourtrustedfreelancer

    (@yourtrustedfreelancer)

    Well, that solution won’t work, it only saves the current date/time

    Thread Starter yourtrustedfreelancer

    (@yourtrustedfreelancer)

    Update:
    I was able to show the form using:

    add_action( 'woocommerce_after_order_notes', 'checkout_date_time_field', 10, 1 );
    function checkout_date_time_field( $checkout ) {
        echo '<div><h2>Date & Time</h2>';
    	echo  acfe_form('date_time'); 
        echo '</div>';
    }

    and save the values using this code after removing all dynamic form post actions:

    add_action( 'woocommerce_checkout_update_order_meta', 'my_custom_checkout_field_update_order_meta' );
    function my_custom_checkout_field_update_order_meta( $order_id ) {
        if ( ! empty( $_POST['acf']['field_5e9b33aa85f9c'] ) ) {
            update_post_meta( $order_id, 'date_time', 'field_5e9b33aa85f9c' );
        }}

    I hope this will help someone.

    Thread Starter yourtrustedfreelancer

    (@yourtrustedfreelancer)

    Thank you for your reply, this is really helpful.
    You are doing a great job, and we all appreciate it.

    With regards.

Viewing 12 replies - 1 through 12 (of 12 total)