we have a problem with newer devices posting comments in the news form with google chrome. If the news is just one everything works fine when you press enter with your phone, but when there are several news and when you press enter just start jumping to the latest news and it only works then. I think the problem is in javascript, so i want to ask you for help. Thanks.
This is javascript;
Our html;
This is javascript;
HTML:
newsReply = function(event, id, item) {
if(event.keyCode == 13 && event.shiftKey == 0){
var content = $(item).val();
var replyTo = id;
if (/^\s+$/.test(content) || content == ''){
return false;
}
if(content.length > 1000){
alert("text is too long");
}
else {
$(item).val('');
if(repNews == 0){
repNews = 1;
$.ajax({
url: "system/action_news.php",
type: "post",
cache: false,
dataType: 'json',
data: {
content: content,
reply_news: replyTo,
token: utk
},
success: function(response){
if(response.code == 1) {
$('.ncmtbox'+replyTo).prepend(response.data);
nrepCount(id, response.total);
repNews = 0;
}
else {
repNews = 0;
return false;
}
},
error: function(){
repNews = 0;
return false;
}
});
}
else {
return false;
}
}
}
else {
return false;
}
}
Our html;
HTML:
<div class="tpad10 reply_post">
<input onkeydown="newsReply(event, <?php echo $boom['id']; ?>, this);" maxlength="500" placeholder="<?php echo $lang['comment_here']; ?>" class="add_comment full_input">
</div>