JSFiddle - React, Tailwind, and code Playground
by akash singh
HTML
<form id="productionForm" name="productionForm" method="POST">
<input type="text" id='ime_2' />
<textarea id='text_2'></textarea> <a href='submit' onclick="send_reply('2','2');return false;" id='test'>TRY </a>
</form>
<div id="reply_error_2"></div>
<input id="cid" />
<input id="cuid" />
JavaScript
function send_reply(id, id2) {
var chk = true;
if ($("#ime_" + id).val().length == 0) {
$("#reply_error_" + id).html("Polje Ime nije popunjeno.").show();//alert();
chk = false;
}
var reply_text = $("#text_" + id).val();
if (reply_text.length == 0) {
$("#reply_error_" + id).html("Polje za odgovor nije popunjeno.").show();
chk = false;
}
if (reply_text.length > 1500) {
$("#reply_error_" + id).html("Odgovor ima više od 1500 karaktera.").show();
chk = false;
}
if (chk) {
$("#cid").val(id);
$("#cuid").val(id2);
}}