Homepage Forums Dev & Debugging What’s going wrong? I am looking for form validation onkeyup Reply To: What’s going wrong? I am looking for form validation onkeyup

  • satyamukherjee

    Administrator
    December 23, 2020 at 12:54 pm
    11500 Coins
    567 Gems
    Helpful
    Up
    0
    Down
    Not Helpful

    You can also write your SK_sendChatMessage function like

    function SK_sendChatMessage(text,recipient_id,e) {

    document.title = document_title;

    textarea_wrapper = $('.chat-textarea');

    chat_messages_wrapper = $('.chat-messages');

    if (e.keyCode == 13 && e.shiftKey == 0 && text == '') {

    alert('enter text');

    }

    else{

    textarea_wrapper.find('textarea').val('');

    chat_messages_wrapper.append('<div class="chat-text align-right temp-text" align="right"><div class="text-wrapper float-right">' + text + '<div class="marker-out"><div class="marker-in"></div></div></div><div class="float-clear"></div></div>');

    $.post(SK_source() + '?t=chat&a=send_message', {text: text, recipient_id: recipient_id}, function (data) {

    chat_messages_wrapper

    .append(data.html)

    .scrollTop(chat_messages_wrapper.prop('scrollHeight'))

    .find('.temp-text')

    .remove();

    });

    }

New Report

Close