0

i need change some values of my form with JS. i yeah, i can see the changes in my form, but when i send the form in my request i cannot see the values that i modify with javascript.

this is code js where i make the updates

               var estructure = $('#SimpleJSTree').jstree(true).get_node(parents[i]).original;
                switch (estructure.est) {
                    case 'fondo':
                        //document.getElementById("found").value = estructure.est;
                        $('#found').val(estructure.est);
                        break;
                    case 'serie':
                        //document.getElementById("serie").value = estructure.est;
                        $('#serie').val(estructure.est);
                        break;
                    case 'subserie':
                        //document.getElementById("subserie").value = estructure.est;
                        $('#subserie').val(estructure.est);
                        break;
                    default:
                        break;
                }

and this is tags that i want changes, obviously all this are in tag form

                        <div class="input-field col s6">
                            <span>Fondo</span>
                            <input id="found" value=""type="text" placeholder="Found" name="found" disabled>
                        </div>
                        <div class="input-field col s6">
                            <span>Seccion</span>
                            <input id="section" type="text" placeholder="Section" name="section" value="">
                        </div>
                        <div class="input-field col s6">
                            <span>Serie</span>
                            <input id="serie" type="text" placeholder="Serie" name="serie" disabled value="">
                        </div>
                        <div class="input-field col s6">
                            <span>Sub Serie</span>
                            <input id="subserie" type="text" placeholder="Sub-Serie" name="subserie" disabled value="">
                        </div>

and this is the request and how you can see in the request i dont have the value of the input that i change

enter image description here

3
  • Dont use disabled, if you use disabled then data wont get passed . Commented Sep 25, 2021 at 23:47
  • @Senthil yeah, that's true. thank you so much bro i confuse the tag i want said readonly Commented Sep 25, 2021 at 23:50
  • if you find it useful, pls upvote Commented Sep 27, 2021 at 5:03

1 Answer 1

1

Your inputs have disabled attribute which means they are not send after form submition just remove that and you should be able to see your inputs on backend

Sign up to request clarification or add additional context in comments.

1 Comment

yeah, that's true. thank you so much bro i confuse the tag i want said readonly

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.