I'm trying to make my Laravel application to access a link from an input field using ctrl pressed key and left click button.
My div looks something like this:
<input type="text" class="linkAccess" id="" name="" value="{{ $DBtable->tableColumn->value }}"
After I save my form and access it again, in this "input" I want my link to be shown and I want to access using that specific combination (ctrl+left click).
I have tried something like this:
$('.linkAccess').click( function (event) {
event.preventDefault();
if(true === event.ctrlKey) {
/* Extract the value */
var $link = $('.linkAccess');
var value = $link.val();
/* Filter out the requests that don't have a key word. */
if('' !== value){
$link.replaceWith( $("<a />").attr({"href" : value, "target":"_blank"}).html(value) );
}
}
})
Any Ideas?