Form action doesn't submit hard-coded variable

后端 未结 3 1028
南笙
南笙 2021-01-26 15:51

I have a form with the code below, which sends form option choice as \"project\" variable.

相关标签:
3条回答
  • 2021-01-26 16:04
    <form name="projects" method="get" action="\web\ttt.php">
        <input type="hidden" name="str" value="aaa" />
        // Other form stuff
    </form>
    
    0 讨论(0)
  • 2021-01-26 16:05

    When using GET as method all query params in the action attribute are discarded and the items in the form are used instead, either change to POST instead of GET or add a hidden field with the name 'str' and value 'aaa' to achieve what your are trying to do.

    0 讨论(0)
  • 2021-01-26 16:30

    You should use an hidden input control to pass variables with a form.

    <input type="hidden" name="myname" value="myvalue" />
    
    0 讨论(0)
提交回复
热议问题