On my site, I have navigation buttons that navigate through results of a search. Basically, what I want to do is to disable certain buttons at certain times (i.e you can't click the next button if you are on the last result). I'm looking for a way to do this. The buttons right now are image buttons and I figure the easiest way would be to switch <input> for <img>. So basically it would look like this.
<input type="image" src="pics/first.png" alt="First Document" name="first" value="First" />
<input type="image" src="pics/previous.png" alt="Previous Document" name="previous" value="Previous" />
<input type="image" src="pics/next.png" alt ="Next Document" name="next" value="Next" />
<input type="image" src="pics/last.png" alt="Last Document" name="last" value="Last" />
would become
<img type="image" src="pics/first.png" alt="First Document" name="first" value="First" />
<img type="image" src="pics/previous.png" alt="Previous Document" name="previous" value="Previous" />
<img type="image" src="pics/next.png"alt ="Next Document" name="next" value="Next" />
<img type="image" src="pics/last.png" alt="Last Document" name="last" value="Last" />
I thought about using str_replace, but I don't necessarily want to change them all, only some of them and different ones at different times. Is there any way I could do this? Or is there another way I could disable them?