Monday 16 July 2012

How to prevent cut, copy and paste into text field useing jquery?

Hellos,

Please write down following javascript:

<script type="text/javascript">
  $(document).ready(function(){
    $('#textField1').bind("cut copy paste",function(e) {
      e.preventDefault();
    });
   });
</script>

Cheers!

Wednesday 11 July 2012

How to get Relative Path and Absolute path from url_for in symfony?

Hi All,

Suppose you have following url:
http://localhost/archive/web/frontend_dev.php/supportTool/searchByWireTransfer

Now

<?php  echo url_for('supportTool/wireTransferDetails'); ?>
The above code will provide following output:
/archive/web/frontend_dev.php/supportTool/searchByWireTransfer

<?php  echo url_for('supportTool/wireTransferDetails', true); ?>
The above code will provide following output:
http://localhost/archive/web/frontend_dev.php/supportTool/searchByWireTransfer

Cheers!