Search found 9 matches

by makamo66
Sun Apr 18, 2021 5:01 am
Forum: PHP General
Topic: Hidden Input Doesn't Change Serverside When Updated in the Client
Replies: 8
Views: 634

Re: Hidden Input Doesn't Change Serverside When Updated in the Client

I don't need to change the value of the hidden input after all. I just need to submit an array with the ids like follows to the database. var draggables = []; draggables.push("draggable3"); draggables.push("draggable4"); and the following alert responds with draggable3, draggable4 as it should alert...
by makamo66
Sat Apr 17, 2021 4:36 pm
Forum: PHP General
Topic: Hidden Input Doesn't Change Serverside When Updated in the Client
Replies: 8
Views: 634

Re: Hidden Input Doesn't Change Serverside When Updated in the Client

The name of the hidden input is the name of the field in the database and so in cakephp it automatically saves the field name/input name to the database when the form is submitted so maybe this is a question for a cakephp forum and not a plain php forum.
by makamo66
Sat Apr 17, 2021 4:29 pm
Forum: PHP General
Topic: Hidden Input Doesn't Change Serverside When Updated in the Client
Replies: 8
Views: 634

Re: Hidden Input Doesn't Change Serverside When Updated in the Client

This only works for the hidden input with the id of draggable4 because that is the last input with the name draggables.
by makamo66
Sat Apr 17, 2021 3:14 pm
Forum: PHP General
Topic: Hidden Input Doesn't Change Serverside When Updated in the Client
Replies: 8
Views: 634

Re: Hidden Input Doesn't Change Serverside When Updated in the Client

I deleted this because it contains misinformation.
by makamo66
Sat Apr 17, 2021 2:35 pm
Forum: PHP General
Topic: Hidden Input Doesn't Change Serverside When Updated in the Client
Replies: 8
Views: 634

Re: Hidden Input Doesn't Change Serverside When Updated in the Client

I deleted this because it contains misinformation.
by makamo66
Sat Apr 17, 2021 1:00 pm
Forum: PHP General
Topic: Hidden Input Doesn't Change Serverside When Updated in the Client
Replies: 8
Views: 634

Re: Hidden Input Doesn't Change Serverside When Updated in the Client

Code: Select all

var z = $("#draggable4").val("draggable4"); 
is an object. If I do alert(z), it shows [object Object].
by makamo66
Sat Apr 17, 2021 10:17 am
Forum: PHP General
Topic: Hidden Input Doesn't Change Serverside When Updated in the Client
Replies: 8
Views: 634

Re: Hidden Input Doesn't Change Serverside When Updated in the Client

Now I'm trying to push the z element to an array but the following code doesn't work. The code adds the last z that was selected to the database instead of adding an array of zs. var draggables = []; if(data == "draggable3"){ alert("data " + data); var z = $("#draggable3").val("draggable3"); draggab...
by makamo66
Sat Apr 17, 2021 8:28 am
Forum: PHP General
Topic: Hidden Input Doesn't Change Serverside When Updated in the Client
Replies: 8
Views: 634

Re: Hidden Input Doesn't Change Serverside When Updated in the Client

I found code that works:

Code: Select all

var z = $("#drag12").val("draggable3");
updates the field in the table with draggable3
by makamo66
Sat Apr 17, 2021 8:00 am
Forum: PHP General
Topic: Hidden Input Doesn't Change Serverside When Updated in the Client
Replies: 8
Views: 634

Hidden Input Doesn't Change Serverside When Updated in the Client

I am trying to set the hidden input in the javascript but it doesn't set it in the php. This is the form with the hidden input. It corresponds to a field in the database table with the name of draggables. <form method="post" accept-charset="utf-8" id="myForm2" action="/mealplans/add"> <input type="h...