Situation:
- The input value is empty and the type is hidden.
- I type ?hiddenname=007 at url
- I click the button"submit" and cause function call()..
Expect:
- The system fills in the value into the input according to ?hiddenname=007 at url using function call()
- after that, the system send the form with value 007 to the server.
Current result:
- the system still send the form with empty value.
url
localhost/index.html?hiddenname=007 index.html
<!DOCTYPE html> <html> <head> <script> function call(){ document.forms["form1"].hiddenname.value=hiddenname; console.log("function run"); } </script> </head> <body> <form name="form1" action="end.php"> <input type="hidden" id="hiddenid" name="hiddenname" value="" /> <input type="submit" id="send" onclick="call()"/> </form> </body> end.php
<?php echo $_GET['hiddenname']; ?> https://stackoverflow.com/questions/66467421/how-to-change-the-value-when-i-type-variable-value-at-url March 04, 2021 at 09:45AM
没有评论:
发表评论