[Résolu] Preview (thumbnail size) of an uploaded image in CRED form workaround
This support ticket is created Il y a 8 années et 5 mois. There's a good chance that you are reading advice that it now obsolete.
This is the technical support forum for Toolset - a suite of plugins for developing WordPress sites without writing PHP.
Everyone can read this forum, but only Toolset clients can post in it. Toolset support works 6 days per week, 19 hours per day.
No supporters are available to work today on Toolset forum. Feel free to create tickets and we will handle it as soon as we are online. Thank you for your understanding.
With the version of CRED you are using, this is the default behaviour that when use an image field with Edit CRED form - it displays the preview of the image (thumbnail).
However, for some investigation purposes, can you please try this with a standard theme of Word Press (i.e. Twenty Fifteen or earlier)? Just to ensure if it's related to your particular theme or plugin itself has an issue.
Also if possible, please provide a URL to examine this online or some screen shots explaining the issue will also be helpful.
Please let me know if I can help you with anything related.
"Edit CRED form - it displays the preview of the image (thumbnail)."
Sorry I meant CREATE CRED form. There is only displaying the file name. I'm searching for a possibility to show an image when creating the form and uploading an image. (multiple)
jQuery(document).ready(function($){
$(".wpt-repetitive").on("change", function(e){
$("input[type=file]").each(function(i){
var tmppath = URL.createObjectURL(this.files[0]);
var h = '<img src="'+tmppath+'" width="50">';
$(this).next().html(h);
});
});
});
Please add this in the JS editor of your "Create" CRED form and save your form. I have tested this thoroughly at hidden link which you can see it working there also.
I hope the code is self-explanatory and should work fine.
Please let me know if it works or not, or if I can help you with anything related.