0
I have a little problem here with Jquery, when the button is clicked I need to take the value of the input and replace the attribute 'href' of one and at the same time click on it... I’m not having results, I can do even the part of replacing the value of the attribute, but I can’t do the click event right after!
btnContacts = boot
contactParams = input text
sendContact = Tag A
Note: this is not a FORM!
$(document).ready( function () {
$('#btnContatos').click( function () {
var contato = $('#contatoParams').val()
//alert(contato)
$('#enviaContato').attr('href', '/chat/busca/'+contato);
// Mexer...
})
}
I think you should use Location.href='/chat/search/'+contact; But by solving your question, adding Rigger doesn’t work? $('#sendContact'). Trigger('click');
– Wilson Faustino
Using Location worked, easier solution than expected... now comes the thick, configure the controllers and models... Thanks friend!
– Gabriel
No need to add "solved" to the question title. You can add your own answer or delete the question.
– Sam
Or accept someone’s answer.
– Caique Romero