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?

Member Avatar for diafol

Is this solved? It's marked as such, although no replies?

Yes sorry. I had been searching on google for a while with no luck. So I posted the question here, but continued searching. I found a solution before a reply came in.

Member Avatar for diafol

No problem, how about posting the solution here in order to help fellow searchers?

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.