Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 6 of 6
  1. #1
    Regular Coder
    Join Date
    Dec 2012
    Posts
    121
    Thanks
    15
    Thanked 1 Time in 1 Post

    Can someone advise me how to add alt desc in php?

    Hi,

    I need to make an amendment to a plugin as it's throwing up validation errors as the alt tag isnt there. I am defining the alt tags so I presume the plugin isn't picking them up. There's no support from creator so any help would be appreciated:-

    The code that I think is relevant is:-

    Code:
    			$ivrss_html = $ivrss_html . "<div class='cas_div' style='height:$dis_height;padding:2px 0px 2px 0px;'>"; 
    			$ivrss_html = $ivrss_html . "<a style='text-decoration:none' target='$ivrss_target' class='cas_div' href='$ivrss_link'><img src='$ivrss_path'></a>";
    			$ivrss_html = $ivrss_html . "</div>";
    			
    			$ivrss_js = $ivrss_js . "ivrss_array[$ivrss_count] = '<div class=\'cas_div\' style=\'height:$dis_height;padding:2px 0px 2px 0px;\'><a style=\'text-decoration:none\'  target=\'$ivrss_target\' href=\'$ivrss_link\'><img src=\'$ivrss_path\'></a></div>'; ";

  2. #2
    Master Coder felgall's Avatar
    Join Date
    Sep 2005
    Location
    Sydney, Australia
    Posts
    7,719
    Thanks
    2
    Thanked 780 Times in 769 Posts
    <img src=\'$ivrss_path\'> doesn't have an alt attribute
    Stephen
    Learn Modern JavaScript - http://javascriptexample.net/
    Helping others to solve their computer problem at http://www.felgall.com/

    Don't forget to start your JavaScript code with "use strict"; which makes it easier to find errors in your code.

  3. #3
    Regular Coder
    Join Date
    Dec 2012
    Posts
    121
    Thanks
    15
    Thanked 1 Time in 1 Post
    Hi Felgall,

    Thanks for your reply... would you know how to add this in?

  4. #4
    Master Coder felgall's Avatar
    Join Date
    Sep 2005
    Location
    Sydney, Australia
    Posts
    7,719
    Thanks
    2
    Thanked 780 Times in 769 Posts
    <img src=\'$ivrss_path\' alt=\"whatever the alt text needs to be\">
    Stephen
    Learn Modern JavaScript - http://javascriptexample.net/
    Helping others to solve their computer problem at http://www.felgall.com/

    Don't forget to start your JavaScript code with "use strict"; which makes it easier to find errors in your code.

  5. #5
    The fat guy next door VIPStephan's Avatar
    Join Date
    Jan 2006
    Location
    Halle (Saale), Germany
    Posts
    9,664
    Thanks
    6
    Thanked 1,143 Times in 1,114 Posts
    And to add to this: The value of the alt attribute can be empty. So only put alternative text there if it is actually feasible (the attribute itself, however, must be present at all times).

  6. #6
    Regular Coder
    Join Date
    Dec 2012
    Posts
    121
    Thanks
    15
    Thanked 1 Time in 1 Post
    Thank you both, this has solved my problem :-)


 

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •