• Resolved itmonitor

    (@itmonitor)


    Hello,

    when no file is selected for download, still the “Download” button in the form is enabled. Is there a way to disable the “Download”button when no file is selected?

    any advice is welcome ??

    Rgs

Viewing 3 replies - 1 through 3 (of 3 total)
  • There is no built-in way to do that. I fixed that issue by modifying the PHP …. as I recall, I had to trace through the program and basically found where I think they ended an if/else branch too early (or something close to that) and adjusted it so that an error or error page was displayed. I don’t have that code handy and it was for a previous version of the plugin, so the line numbers would have changed … I think I posted it in a support item a long time ago, though I’m having trouble finding some of my old support items now. I can try and track it down if you think you want to go that route. Alternatively, it might be easier to just use some jquery. There are a lot of examples online about enabling/disabling submit buttons when a checkbox is checked or unchecked.

    Ah, I found the old item. See my last reply in this long thread (it will be almost at the bottom): https://www.ads-software.com/support/topic/checkbox-non-coche-et-envoi-du-formulaire/

    Now, again, that line number may not be correct any more, but I suspect you’ll find that bit of code even in the newer EBD versions & can make the change I mention. (Don’t use the earlier changes I posted in there as those don’t fully work .. you need to use the last one I posted .. near the bottom).

    Thread Starter itmonitor

    (@itmonitor)

    @dtynan, thank you for taking the time to help me. Your code works fine. I post it here so it can help others. Many thanks! ??

    Solution by dtynan:

    In plugins/email-before-download/email-before-download.php, replace

    else if(!empty($d) || !empty($ebd_item->file) ){
    by
    else if( (!empty($d) || !empty($ebd_item->file)) && strpos($ebd_item->download_id,',') === FALSE ){

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Warn when no file selected for download’ is closed to new replies.