Click here to Skip to main content
15,902,635 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi,
I would like to delete the link permanently after it has been sent and replace with an image to know the user knows that this invoice has been sent..

<?php echo anchor('invoices/submit/invoice_id/'; . $invoice->invoice_id, $this->lang->line("submit";)); ?>
Thanks,
Olive
Posted
Comments
Sandeep Mewara 30-Sep-10 7:12am    
Ok. Do it! Whats stopping you?
chopoe 30-Sep-10 7:16am    
Hi Sandeep Mewara,
I don't know how to permanently hide the link after it has been clicked and replace with an image..:((

1 solution

Give your link an ID of Link1. Put the link in a DIV with an ID of Div1. Put the image you wish to show in a DIVE with an ID of Div2 and set the style to style="display:none;".

Finally, add this code to the bottom of your page:
XML
<script language="javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.4.2/jquery.min.js" type="text/javascript"></script>
<script language="javascript" type ="text/javascript">
    $(function () {
        $("#Link1").click(function () {
            $("#Div1,#Div2").toggle();
        }
    )
    });
</script>


What we're doing here is creating containers for the UI elements that we want to hide/display. We load the jQuery library and then add a click handler for your link (you can use anything, like a button, div, whatever).

The click handler simply selects the two divs and toggles their visibility.

Cheers.
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900