Php 功能不反应
我需要帮助写下一个代码 我在一边有数字,当我点击它们时(它们充当链接),它们被添加到输入框中(在同一文档中,每个数字都有特定的框)。然后我有一个函数,它读取写在那个框中的内容,使用那个值并进行一些计算,然后在同一页上显示它,而不刷新。当我手工写数字时,一切都很顺利,但当我使用函数时Php 功能不反应,php,javascript,html,input,Php,Javascript,Html,Input,我需要帮助写下一个代码 我在一边有数字,当我点击它们时(它们充当链接),它们被添加到输入框中(在同一文档中,每个数字都有特定的框)。然后我有一个函数,它读取写在那个框中的内容,使用那个值并进行一些计算,然后在同一页上显示它,而不刷新。当我手工写数字时,一切都很顺利,但当我使用函数时 function addTextTagF(text){ document.getElementById('text_tag_inputF').value += text; } 什么也没发生! 我需要做出某种
function addTextTagF(text){
document.getElementById('text_tag_inputF').value += text;
}
什么也没发生!
我需要做出某种反应,请帮帮我
其他使用的功能:
function preview_kopins(currency)
{
var rate = 0.0025;
var food = window.document.frm.food.value;
food = food * rate;
total = food;
if(isNaN(total))
total = "0";
document.getElementById("pkopins").innerHTML = total + " " + currency;
}
另一个
<input type="text" id="text_tag_inputF" name="food" size="5" value=""
onchange="preview_kopins('<?php echo CURRENCY_NAME ?>');"
onkeypress="preview_kopins('<?php echo CURRENCY_NAME ?>');"
onpaste="preview_kopins('<?php echo CURRENCY_NAME ?>');"
oninput="preview_kopins('<?php echo CURRENCY_NAME ?>');" >
<a href="#"
onClick="addTextTagF('<?php echo floor($fcapacity); ?>'); return false">
<?php echo floor($fcapacity); ?></a>
据我所知,您想将编号添加到当前的文本\u标签\u输入编号中
尝试:
这是表格的样子:当我点击右边的数字时,什么也没发生(它应该计算并在底部显示总成本)
function addTextTagF(text){
document.getElementById('text_tag_inputF').value = document.getElementById('text_tag_inputF').value + parseInt(text);
}