pugjs / pug

Pug – robust, elegant, feature rich template engine for Node.js
https://pugjs.org
21.54k stars 1.96k forks source link

form tag problem #3397

Closed callor closed 1 year ago

callor commented 1 year ago

Pug Version: your version number here 3.0.2 Node Version: your version number here 18.12.0

Input JavaScript Values

res.render("food_input")

Input Pug

 form(method="POST").today
    input(name="t_seq",value="0")
    tr 
        td
            input(name="t_date" placeholder="Please Enter Date")
        td
            input(name="t_time" placeholder="Please Enter Time")
        td
            input(name="t_content" placeholder="Please Enter Content" )
        td
            input(name="t_qty" type="number",placeholder="Please Enter QTY")
        td
            input(name="t_cal" type="number",placeholder="Please Enter Cal")
        td
            button(type="button").today.input ADD
            button(type="reset").today.reset NEW

Expected HTML

<h1>I Love Pug</h1>
<p>It's a great language</p>

Actual HTML

 <form class="today" method="POST">
    <input name="t_seq" value="0" />
        <tr>
            <td>
                <input name="t_date"  placeholder="Please Enter Date"  />
            </td>
            <td>
                <input name="t_time" placeholder="Please Enter Time" />
            </td>
            <td>
                <input name="t_content" placeholder="Please Enter Content"/>
            </td>
            <td>
                <input name="t_qty" type="number" Please Enter QTY"/>
            </td>
            <td>
                <input name="t_cal" type="number" placeholder="Please Enter Cal"  />
            </td>
            <td> 
                <button class="today input" type="button">ADD</button>
                <button class="today reset" type="reset">NEW</button>
            </td>
       </tr>
</form>

Additional Comments

ISSUE

  1. In source view it looks normal
  2. But in chrome developer tools it looks like an image
  3. form tag does not wrap input
  4. const inputs = document.querySelectAll("form.today input") : Appears as null value in inputs
  5. Selector does not work normally in Vanilla JS code
callor commented 1 year ago

ㅠㅠ Not review