私はこの機能を使用しようとしています:
function storagecalc(){
var thediv=document.forms["boxes"];
var boxno=thediv.elements["numbofboxes"];
var howmany =0; //If the textbox is not blank */
if(boxno.value!="")
{
howmany=parseInt(quantity.value);
}
return howmany;
document.getElementById('numberprice').innerHTML = "£"+howmany;
}
ここに入力された値を取得するには:
<form action="" id="boxes">
<input type="text" id="numbofboxes" value="" name="boxnumber"/>
<button id="smtbxno" onclick="storagecalc">
<img src="images/tick.gif" alt="proceed"/>
</button>
</form>
ここに表示します。
<div id="grandtotal">
<p class="calctitles">
Grand Total
</p>
<p id="numberprice">
</p>
</div>
テキストボックスに値を入力してボタンをクリックしても何も起こりません。これは、クリックするとボタン自体とテキストボックスを非表示にするjQueryもあるからですか? なぜそれがうまくいかないのかについての提案はありませんか?