dchacons
Forum Replies Created
-
A third option would be to use AJAX to send the form, thus after a fail validation the form is not submitted and the type = “file” is not lost.
An example for implementig this: https://hayageek.com/examples/jquery/ajax-form-submit/index.php?tab=2
After some search about this i found that:
You can save the data in variables and populate it later, except for the type=”file” input field. It will be a security problem if the files can be prepopulated(or say selected without user permission) and browsers won’t allow it.
One option is to save the file in any temporary folder in server and if validations worked fine, move it to the uploads directory.
Another option is to show your form in steps(in pages) and the file upload option in the last step, so that the user will reach the file upload section after all validations and you can do the file upload validation in the last step.
Hi Mike, first of all thank you for this amazing plugin, congratulations.
As chuckster_pl said, this is a problem in all browsers, my site’s users report me this problem, there is no way to fix this? I noticed that other fields like inputs doesn’t lost their values after a fail validation, question: if the text field of the image location is changed for a read-only input doesn’t the problem will be solved?
Thanks, hope you can help me.
Forum: Fixing WordPress
In reply to: Add html code before first post when using WP Page NumbersOk I made it, wp rules ?? I select the ID of the last post (last date) and print the html only if the actual post id is the same as the last post id
$post_id = $wpdb->get_var($wpdb->prepare("SELECT ID FROM $wpdb->posts WHERE post_status = 'publish' AND post_type = 'post' ORDER BY post_date DESC LIMIT 0 , 1;")); while (have_posts()) { if($post->ID == $post_id){?> //add html code ...
Forum: Fixing WordPress
In reply to: Add html code before first post when using WP Page NumbersOk I get all post number, in this case 15 as I want, but the pboblem is that as I display 2 for page and use pagination, every time I clic on a page number link the $counter stars again in 1 so the $counter+1 is never equal to 15 as I want to know if is the last post in my index, this is the code, again the question is how to know that a post is the last one so I can put some html code before it?
<?php get_header(); if (have_posts()) { $counter= 1; $post_count = $wpdb->get_var($wpdb->prepare("SELECT COUNT(*) FROM $wpdb->posts WHERE post_status = 'publish' AND post_type = 'post' ;")); echo '<p>total POSTS: ' . $post_count . '</p>'; while (have_posts()) { echo '<p>Counter: ' . $counter. '</p>'; if($counter+1 == $post_count){?> //....HTML FOR FIRST POST <?php }else{ $contador++; } art_post(); } art_page_navi(); if(function_exists('wp_page_numbers')) { wp_page_numbers(); } } else { art_not_found_msg(); } get_footer();