Hello,
I’ve created a form to be submitted via serverconnectform. The first field is a textarea followed by a number of fields, nothing that has ever broken before.
When the form is submitted, I get a [object%20HTMLTextAreaElement] error in the xhr inspector and when I check the API page called, I see a 404 as it’s trying to fetch [object%20HTMLTextAreaElement] instead of the actual action page (PHP model).
Would anyone have any suggestion on how to track what is wrong? The form is fairly complex and I’d rather not create it from scratch again.
Thanks!
Teodor
March 21, 2022, 7:59pm
2
Hi, please check this topic:
Wappler Version : 3.3.6
Operating System : php or node
Expected behavior
When adding an input to a form, the name attribute should be able to be set to “action”
Actual behavior
The following input:
<input type="text" class="form-control" id="inp_action" name="action" aria-describedby="inp_action_help" >
produces the following request url:
https://wappler.uniqueideas.com/[object%20HTMLInputElement]
however, changing the name attribute to “operation”, works fine.
Thanks very much @Teodor - am I right to assume that [object%20HTMLTextAreaElement]
points to a textarea being a suspect? I have two of them and they don’t seem to have conflicting names.
I’ll do additional debugging with a fresh pair of eyes tomorrow.
Teodor
March 21, 2022, 8:22pm
4
Maybe paste the html of your textaareas so we can check.
Sure:
<form id="form_edit_gap" is="dmx-serverconnect-form" method="post" action="dmxConnect/api/general/update_gaps.php" dmx-on:success="notifies.info('Item updated');modal_edit_gap.hide();list_open_gaps.load();list_closed_gaps.load()">
<div class="form-row">
<textarea id="gap_edit" class="form-control" dmx-bind:value="data_detail_gap.data.gap" rows="5"></textarea>
</div>
<div class="form-row mt-2">
<div class="col-2 align-self-center">Opened:</div>
<div class="col">
<input id="date_open_gap" name="date_open_gap" type="text" class="form-control" dmx-bind:value="data_detail_gap.data.date_open">
</div>
</div>
<div class="form-row mt-2">
<div class="col-2 align-self-center">Last updated:</div>
<div class="col">
<input id="date_update_gap" name="date_update_gap" type="text" class="form-control" dmx-bind:value="data_detail_gap.data.date_update">
</div>
</div>
<div class="form-row mt-2">
<div class="col-2 align-self-center">Status:</div>
<div class="col">
<div class="custom-control custom-switch">
<input class="custom-control-input" type="checkbox" value="" id="close_date" name="close_date" dmx-bind:value="date_time.datetime.formatDate('dd/MM/yyyy HH:mm:ss')" dmx-bind:checked="(var_status.value == 'Open')" dmx-on:click="flow_update_status.run()">
<label class="custom-control-label" for="close_date" dmx-text="var_status.value">Open</label>
</div>
</div>
</div>
<div class="form-row mt-2">
<div class="col-2 align-self-center">Category:</div>
<div class="form-group row">
<div class="col-sm-4 mt-0 ml-0 pt-2" dmx-repeat:repeat_categories="list_categories.data.list_categories">
<div class="form-check">
<input class="form-check-input" type="checkbox" value="" id="ID_category" name="ID_category[]" dmx-bind:value="list_categories.data.list_categories[0].ID_category" dmx-bind:checked="data_detail_gap.data.category.split(',').contains($value)">
<label class="form-check-label" for="ID_category" dmx-text="category">Default checkbox</label>
</div>
</div>
</div>
</div>
<div class="form-row mt-2">
<div class="col-2 align-self-center">Action:</div>
<div class="col">
<textarea id="action" class="form-control" name="action" dmx-bind:value="data_detail_gap.data.action" rows="5"></textarea>
</div>
</div>
<div class="form-row mt-2">
<div class="col-2 align-self-center">Owner:</div>
<div class="col">
<select id="owner" class="form-control" name="owner" dmx-bind:value="data_detail_gap.data.owner" dmx-bind:options="list_users.data.list_users" optiontext="Firstname+' '+Lastname" optionvalue="Email">
</select>
</div>
</div>
<div class="form-row mt-2">
<div class="col-2 align-self-center">Comments:</div>
<div class="col">
<textarea id="comments_gap" class="form-control" name="comments_gap" dmx-bind:value="data_detail_gap.data.comments"></textarea>
<input id="edit_gap_ID" name="edit_gap_ID" type="hidden" class="form-control" dmx-bind:value="data_detail_gap.data.ID_gap">
</div>
</div></form>
bpj
March 21, 2022, 8:56pm
6
It has a static name of 'action' - that is your culprit, I reckon
3 Likes
Oh, of course! I don’t even know how I missed that - too long a day, we’ll say.
It’s indeed the culprit. Thanks a ton @bpj and @Teodor .
2 Likes