簡體   English   中英

使用HTML輸入元素(類型=“提交”),我們如何自定義GET字段?

[英]Using HTML input element (type=“submit”), how can we customize the GET field?

使用<form method="get">元素(包括<input type="submit">元素),我們可以獲取具有由<input type="text" name="studentId">指定的某些字段的網頁元素,但是我可以自定義這些字段嗎?

例如:我總是想在GET網址上添加一個action=true ,以使該URL像這樣: http://example.com/?studentId=123&action=true : http://example.com/?studentId=123&action=true ?studentId action=true

使用<input type="hidden" name="action" value="true" />

在您的表單中。

您可以添加一個隱藏的表單字段,盡管名稱action不是一個好字段,因為form具有action屬性,並且在編寫表單腳本時此名稱可能會沖突:

<input type="hidden" id="something" name="something" value="somthingelse" />
 <div id="gbqffd">
   <input type="hidden" value="en" name="h1">
   <input type="hidden" value="d" name="tbo">
   <input type="hidden" value="search" name="output">
   <input type="hidden" value="psy-ab" name="sclient">
 </div>

Google總是有答案的; 在這種情況下,我無需搜索即可,只需查看源代碼即可:)

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM