将输入标记值传递给href参数 [英] Pass input tag value to as href parameter

查看:94
本文介绍了将输入标记值传递给href参数的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想将输入标记的值作为参数(quantita)传递给href。
我应该用javascript来做这个吗?抱歉我的英文
谢谢

I want to pass the value of input tag as parameter(quantita) in href. Should i use javascript to do this?Sorry for my english Thanks

<input type="text" id="qta_field" value="${item.value}"/><a href="updateItem?codice=${item.key.codice}&quantita=">update</a>

推荐答案

使用链接和没有任何库的最简单方法:

The easiest way to do it with link and without any library:

<input type="text" id="qta_field" value="${item.value}"/>
<a href='' onclick="this.href='updateItem?codice=${item.key.codice}&quantita='+document.getElementById('qta_field').value">update</a>

这篇关于将输入标记值传递给href参数的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆