如何获得输入值? [英] How to get input value?

查看:110
本文介绍了如何获得输入值?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述



i有这样的输入

Hi,
i have input, like this

<input type="text" id="inputSom" name="cEmail" />





和javascript



and javascript

function prodAvail()
{
    return(document.getElementById('inputSom').value);

}





和href



and href

<a id="hrefId" href="/CuAv.aspx?productID={ProductID}&customerID={/root/System/CustomerID}&variantID={VariantID}&customerMAil=????" >Go to</a>





我如何获得价值(客户邮箱) )从输入和发送与href?而不是最后一个参数,现在在哪里'????'。



谢谢



How i can get value(customer email) from input and send it with the href? Instead of the last parameter, where is now '????'.

Thanks

推荐答案

好吧,我用js解决了这个问题。我的解决方案:

Ok, i solved this problem with js. My solution:
<script type="text/javascript">
  function prAv()
  {
  var pID=<xsl:value-of select="ProductID" xmlns:xsl="#unknown" />;
  var vID=<xsl:value-of select="VariantID" xmlns:xsl="#unknown" />;
  var cID=<xsl:value-of select="CustomerID" xmlns:xsl="#unknown" />;
  var mail=document.getElementById('inputSom').value;

  var url="/CuAv.aspx?pID="+pID+"&cID="+cID+"&vID="+vID+"&mail="+mail;
  window.location.href =url;


  }
</script>







<a id="inputSom" href="javascript:prAv();">Go to</a>


您的解决方案在这里



http://stackoverflow.com/questions/27013911/get -value-of-form-text-field-without-without-the-form-form [ ^ ]
Your solution is here

http://stackoverflow.com/questions/27013911/get-value-of-form-text-field-with-without-submitting-the-form[^]


这篇关于如何获得输入值?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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