user979331
user979331

Reputation: 11861

Anchor link disappears after click in IE

I am using site_url for buttons in CodeIgniter, when you click the button a PDF downloads. it works fine in Chrome and Firefox, but in IE when I click on the button the PDF downloads, but the button disappears. What Am I doing wrong?

here is the whole code <li><a href="<?php echo site_url('admin/button/pdf');?>">Download PDF</a></li>

Upvotes: 1

Views: 1416

Answers (1)

Sparky
Sparky

Reputation: 98738

<a href="<?php echo site_url('admin/button/pdf');?>">Download PDF</a>

Quote OP: "in IE when I click on the button the PDF downloads, but the button disappears."

That's not a button, that's an anchor tag, <a></a>. And since PHP code is processed on the server before it gets to any browser, your problem has nothing to do with PHP or CodeIgniter.

Sound like you have a CSS issue if the link vanishes after you click it... maybe the :visited pseudeo-class changes the font color to something that matches your background?

Check your CSS file for rules like this.

 background-color: #ffffff;

You're looking for background-color on things like body, ul, li or whatever specific parent element contains your download link.

Then check for rules similar to this.

a:visited {
    color: #ffffff;
}

where a is targeting your specific download link. It's likely that the color value on this is matching its background-color. Also, if this only happens in IE, then you may have some poorly written or invalid CSS pseudo-class selectors.

Upvotes: 2

Related Questions