Note that there are some explanatory texts on larger screens.

plurals
  1. POAllow only one checkbox selected. 1 checkbox each in two independent forms, all on one page
    primarykey
    data
    text
    <p>I have a HTTP interface page that requires the user to upload various independent files. For this I have created multiple tables that each have its own form. </p> <p>In two of the tables I need one checkbox each that allows the user to select it which then requires that the file is installed on system startup. </p> <p>Both tables are for uploading system firmware, one table for primary firmware, and the other for backup firmware. </p> <p>The system will crash if both firmwares are being uploaded, hence separate forms. </p> <p>Because of this crashing issue, for the two checkboxes it needs to be: One selected, or the other selected, or neither selected.</p> <p>Here is a sample html code:</p> <pre><code>&lt;body&gt; &lt;div id="container"&gt; &lt;table width="1000" border="0" cellpadding="1" class="uploadBox"&gt; &lt;tr&gt; &lt;td width="460" rowspan="2"&gt; &lt;form action="fileupload.html" method="post" enctype="multipart/form-data"&gt; &lt;b&gt;Update Primary System Firmware&lt;/b&gt; &lt;p style="margin-bottom: 2px"&gt; &lt;b&gt;File: &lt;/b&gt; &lt;input type="file" name="firmwaremain" size="30" /&gt; &lt;input type="submit" value="Upload" /&gt; &lt;/p&gt; &lt;/td&gt; &lt;td width="210" height="23"&gt;Current File Name:&lt;/td&gt; &lt;td width="117"&gt;Current File Size:&lt;/td&gt; &lt;td width="102"&gt;File Upload Date:&lt;/td&gt; &lt;td width="93"&gt;Install on Start&lt;/td&gt; &lt;/tr&gt; &lt;tr&gt; &lt;td&gt;~curFirmName~&lt;/td&gt; &lt;td width="117"&gt;~curFirmSize~&lt;/td&gt; &lt;td width="102"&gt;~curFirmDate~&lt;/td&gt; &lt;td width="93"&gt;&lt;input type="checkbox" name="firmPrim" id="firmPrim" /&gt;&lt;/td&gt; &lt;/tr&gt; &lt;/table&gt; &lt;/form&gt; &lt;table width="1000" border="0" cellpadding="1"&gt; &lt;tr&gt; &lt;td width="460" rowspan="2"&gt; &lt;form action="fileupload.html" method="post" enctype="multipart/form-data"&gt; &lt;b&gt;Update Backup System Firmware&lt;/b&gt; &lt;p style="margin-bottom: 2px"&gt;&lt;b&gt;File: &lt;/b&gt; &lt;input type="file" name="firmwarebackup" size="30" /&gt; &lt;input type="submit" value="Upload" /&gt; &lt;/p&gt; &lt;/td&gt; &lt;td width="210" height="23"&gt;Current File Name:&lt;/td&gt; &lt;td width="117"&gt;Current File Size:&lt;/td&gt; &lt;td width="102"&gt;File Upload Date:&lt;/td&gt; &lt;td width="93"&gt;Install on Start&lt;/td&gt; &lt;/tr&gt; &lt;tr&gt; &lt;td&gt;~curBackName~&lt;/td&gt; &lt;td width="117"&gt;~curBackSize~&lt;/td&gt; &lt;td width="102"&gt;~curBackDate~&lt;/td&gt; &lt;td width="93"&gt;&lt;input type="checkbox" name="firmBackup" id="firmBackup" /&gt;&lt;/td&gt; &lt;/table&gt; &lt;/form&gt; &lt;/div&gt; </code></pre> <p></p> <p>As you can see, they checkboxes are in two independent forms, so it has been difficult for me to run a JavaScript code, since (I think) it calls for the checkboxes to be in one form. </p> <p>Also I cant use radio buttons because they are in different forms, plus there has to be an option for neither to be selected.</p> <p>Is there a way to validate the whole page and check all forms so that only one check box can be selected on the page? </p> <p>Thanks!</p> <p>Regards, Josh</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