Changing image reference to html button PHP

Discussion in 'PHP' started by Grimmfang, Jan 2, 2012.

  1. #1
    I have a string that defines a action to be carried out by a image, I want to change that image to an html button.

    $EXAMPLE_STRING = "<img src='".IMAGE."generic/".IMODE."/search.png' style='width: 16px; height: 16px; vertical-align: top'
    alt='".LAN_SEARCH_23."' title='".LAN_SEARCH_23."' onclick=\"expandit('en_in'); expandit('en_ex'); expandit('en_ep'); expandit('en_be')\"/>";
    PHP:

     
    Grimmfang, Jan 2, 2012 IP
  2. jestep

    jestep Prominent Member

    Messages:
    3,659
    Likes Received:
    215
    Best Answers:
    19
    Trophy Points:
    330
    #2
    You would just use a submit input.

    
    <input type="submit" onclick="expandit('en_in'); expandit('en_ex'); expandit('en_ep'); expandit('en_be')" />
    
    Code (markup):
     
    jestep, Jan 3, 2012 IP
  3. Grimmfang

    Grimmfang Member

    Messages:
    191
    Likes Received:
    1
    Best Answers:
    0
    Trophy Points:
    30
    #3
    presents an error
     
    Grimmfang, Jan 10, 2012 IP
  4. bartolay13

    bartolay13 Active Member

    Messages:
    735
    Likes Received:
    14
    Best Answers:
    1
    Trophy Points:
    98
    #4
    this is event handling probably best in js section.

    the answer is simple, instead of <img> tag use <button>
     
    bartolay13, Jan 11, 2012 IP