第七色在线视频,2021少妇久久久久久久久久,亚洲欧洲精品成人久久av18,亚洲国产精品特色大片观看完整版,孙宇晨将参加特朗普的晚宴

為了賬號安全,請及時綁定郵箱和手機立即綁定
已解決430363個問題,去搜搜看,總會有你想問的

將搜索框中的輸入附加到按鈕鏈接中

將搜索框中的輸入附加到按鈕鏈接中

PHP
倚天杖 2023-05-26 16:01:02
我會讓這個簡短而快速。:)我正在嘗試在我的網(wǎng)站上實現(xiàn)一個按鈕,它將我重定向到我指定的 URL + 用戶正在尋找的內(nèi)容。我這里有一小段代碼:<html> ??<div?class="search"> ????<form?role="search"?method="get"?id="search"> ????????<div> ????????????<input?type="text"?value=""?name="tag_search"?id="tag_search"?/> ????????????<input?type="button"?value="Cerca"?onclick="window.location.?/> ????????</div> ????</form> ??</div></html>這幾乎是工作。
查看完整描述

2 回答

?
慕森卡

TA貢獻1806條經(jīng)驗 獲得超8個贊

將輸入的值添加到鏈接


<html>

  <div class="search">

    <form role="search" method="get" id="search">

      <div>

        <input type="text" value="" name="tag_search" id="tag_search" />

        <input type="button" value="Cerca" 

          onclick="window.location.href='https://mywebsite.com/' + 

          document.getElementById('tag_search').value" />

      </div>

    </form>

  </div>

</html>


查看完整回答
反對 回復(fù) 2023-05-26
?
慕勒3428872

TA貢獻1848條經(jīng)驗 獲得超6個贊

添加以下Javascript來幫助


<script>

function goToSearch() {

    window.location.href= 'https://mywebsite.com/' + encodeURI(document.getElementById("tag_search").value)

}


</script>

那么你的 HTML 應(yīng)該是這樣的


<html>

  <div class="search">

    <form role="search" method="get" id="search">

        <div>

            <input type="text" value="" name="tag_search" id="tag_search" />

            <input type="button" value="Cerca" onclick="goToSearch()" />

        </div>

    </form>

  </div>

</html>


查看完整回答
反對 回復(fù) 2023-05-26
  • 2 回答
  • 0 關(guān)注
  • 147 瀏覽

添加回答

舉報

0/150
提交
取消
微信客服

購課補貼
聯(lián)系客服咨詢優(yōu)惠詳情

幫助反饋 APP下載

慕課網(wǎng)APP
您的移動學(xué)習(xí)伙伴

公眾號

掃描二維碼
關(guān)注慕課網(wǎng)微信公眾號