Note that there are some explanatory texts on larger screens.

plurals
  1. POFind whether check boxes are checked inside a servlet
    primarykey
    data
    text
    <p>I have several check box in a form I just wanna way to check whether they are checked or not .</p> <p>If checked i need to store their id in the database(that i can do it ) . But my question is how to determine whether are checked or not instead of checking for each check box on at a time . <strong>I need to check whether its checked or not inside a servlet.</strong></p> <p>This is my code</p> <pre><code>&lt;!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"&gt; &lt;html&gt; &lt;head&gt; &lt;meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1"&gt; &lt;title&gt;Insert title here&lt;/title&gt; &lt;/head&gt; &lt;body&gt; Role Id&lt;input type="text" name="roll_id"/&gt;&lt;br&gt; Role Name&lt;input type="text" name="roll_name"/&gt;&lt;br&gt; Role Description&lt;textarea name="roll_desc"&gt;&lt;/textarea&gt;&lt;br&gt; &lt;br&gt; &lt;br&gt; Screen1&lt;br&gt; tab1&lt;br&gt; &lt;input type="checkbox" name="s1_t1_view" value="s1_t1_view" &gt;view&lt;br&gt; &lt;input type="checkbox" name="s1_t1_add" value="s1_t1_add" &gt;add&lt;br&gt; &lt;input type="checkbox" name="s1_t1_edit" value="s1_t1_edit" &gt;edit&lt;br&gt; &lt;input type="checkbox" name="s1_t1_delete" value="s1_t1_delete" &gt;delete&lt;br&gt; tab2&lt;br&gt; &lt;input type="checkbox" name="s1_t2_view" value="s1_t2_view" &gt;view&lt;br&gt; &lt;input type="checkbox" name="s1_t2_add" value="s1_t2_add" &gt;add&lt;br&gt; &lt;input type="checkbox" name="s1_t2_edit" value="s1_t2_edit" &gt;edit&lt;br&gt; &lt;input type="checkbox" name="s1_t2_delete" value="s1_t2_delete" &gt;delete&lt;br&gt; Screen2&lt;br&gt; tab1&lt;br&gt; &lt;input type="checkbox" name="s2_t1_view" value="s2_t1_view" &gt;view&lt;br&gt; &lt;input type="checkbox" name="s2_t1_add" value="s2_t1_add" &gt;add&lt;br&gt; &lt;input type="checkbox" name="s2_t1_edit" value="s2_t1_edit" &gt;edit&lt;br&gt; &lt;input type="checkbox" name="s2_t1_delete" value="s2_t1_delete" &gt;delete&lt;br&gt; tab2&lt;br&gt; &lt;input type="checkbox" name="s2_t2_view" value="s2_t2_view" &gt;view&lt;br&gt; &lt;input type="checkbox" name="s2_t2_add" value="s2_t2_add" &gt;add&lt;br&gt; &lt;input type="checkbox" name="s2_t2_edit" value="s2_t2_edit" &gt;edit&lt;br&gt; &lt;input type="checkbox" name="s2_t2_delete" value="s2_t2_delete" &gt;delete&lt;br&gt; &lt;input type="submit" name="sumbit" text="submit"&gt; &lt;/body&gt; &lt;/html&gt; </code></pre> <p>But in my code I have several check boxes . I need to hardcode that for every check box . Is there way so that i put it in a loop and check for all check boxes ?</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