Note that there are some explanatory texts on larger screens.

plurals
  1. POjavascript this.form returns unexpected form
    primarykey
    data
    text
    <p>so i got some enclosing form and two nested forms. the two nested forms are evaluated with ajax on buttonclick and the external form has a submit-button.</p> <p>simplified markup:</p> <pre><code>&lt;form id="form1" action="default.asp"&gt; //some fields inside a list with unnecessary text &lt;input type="text" name="shortdesc"/&gt; &lt;form id="deleteform" action="delete.asp"&gt; //dynamically generated checkboxes &lt;input type="checkbox" name="deleter" value="somedocument.txt"&gt;somedocument.txt&lt;br&gt; &lt;input type="checkbox" name="deleter" value="some_otherdocument.doc"&gt;some_otherdocument.doc&lt;br&gt; &lt;input type="button" onclick="console.log(this.form); ajaxcall('delete.asp', this.form);" /&gt; &lt;/form&gt; &lt;form id="addfileform" action="upload.asp"&gt; &lt;input type="file" name="file"/&gt; &lt;input type="button" onclick="console.log(this.form); ajaxcall('upload.asp', this.form);" /&gt; &lt;/form&gt; &lt;input type="button" value="send" onclick="dataValidation(form1),"/&gt; &lt;/form&gt; </code></pre> <p>When checking a checkbox and "submitting" the form, console logs outer form, but when chosing a file and "sumbitting" that, the correct form gets logged.</p> <p>can someone shed some light on why and /or how to fix this?</p> <hr> <p>for clarification: this is supposed to be some site (<strong>not HTML5</strong>) where you can submit some text-fields to ask the CEO for some changes. i am now supposed to implement a file-append.</p> <p>The form is handled and created with asp classic (<em>oh the agony, but well...</em>) and as i am not really keen to keep the whole form-data throughout <strong>two</strong> redirects(one for the upload and one for the displaying of uploaded files) i had decided to go for AJAX.</p> <p>FYI: console.log(document.getElementById('deleteform')) returns <em>undefined</em></p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload