So I write down the value of the inpatu using jQuery and visually it is written (the required value appears in the field), only the form says that it is empty. Because of what is not sent.

var arr = [{ value: 6, list: [{ value: 0, text: 'A3' }, { value: 1, text: 'A4' }, { value: 2, text: 'A5' } ] }, { value: 7, list: [{ value: 0, text: 'M3' }, { value: 1, text: 'M6' }, { value: 2, text: 'X5' }, { value: 3, text: 'X6' } ] }, ]; $("#category").change(function() { selval = $(this).val(); forval = arr[selval - 6].list; $("#selectmodel").empty(); $.each(forval, function(i, val) { $("#selectmodel").append("<option value='" + val.text + "'>" + val.text + "</option>"); }) }); $("#selectmodel").change(function() { text = $(this).val(); $("#xf_model").val(text); }); 
 <script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script> <select id="category"> <option value="6">значение 6</option> <option value="7">значение 7</option> </select> <select id="selectmodel"> </select> <input type="text" name="xfield[model]" id="xf_model" value="" rel="essential" data-rel="links" /> 

  • And how exactly does the form "say it is empty"? Explain how you check it. Is the check on the server? If so, attach the verification code as well. - RAMe0
  • The point is not to check, even on the server, even in the client says that the field is empty (without checking anywhere). And if you press Ctrl + Shift + I then the value of input is empty. - karakym
  • so it should not change there. There HTML is displayed. You first try to get data on the server. And then you say that it is not transmitted. Everything works fine for me: main.xfiddle.com/19a5ec5b/1.php - RAMe0
  • If I manually enter the value in the field, the form sends without problems. If I write down the script, the form scolds to an empty field - karakym
  • I just ask about it. How exactly the form swears? How do you verify that the value is filled? If using JS, give the verification code. Did you watch an example by reference? There's nothing swears and the data is sent. - RAMe0

0