如何将JavaQuery值转换为PHP代码以保存在数据库中(MYSQL) [英] How to get javaquery values into php code to save in databasc(MYSQL)

查看:58
本文介绍了如何将JavaQuery值转换为PHP代码以保存在数据库中(MYSQL)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

你好朋友

我正在使用javascript动态生成文本框.通过单击按钮,java脚本将调用并添加新的文本框,并且对于每个文本框,循环中都会生成不同的名称和ID.


我想将这些文本框值存储在数据库中,如何捕获该文本框值

看到我的代码

Hi friends

i am generating textboxes dynamically using javascript By clicking button the java script will call and add new textbox and for every textbox different name and id is generating in loop.


i want to store those textbox values in Database how can i catch that textbox value

see my code

$('.addrownew').live('click',function(){
	if(counter>20){
            alert("you count has reached 15 ..please check once");
            return false;
	} 
var row='<div class="itemwraprow"><div class="slnodiv"></div><div class="itemdiv"><input name="item' + counter +'" id="item' + counter +'" type="text"  class="item"  önchange="selectvalue3();"/></div><div class="partnodiv"><input name="partno' + counter + 
	      '" type="text" class="partno" id="partno' + counter + 
	      '" readonly="readonly" /></div><div class="pricediv"> <input name="price' + counter + 
	      '" id="price' + counter + 
	      '" type="text"  class="price" name="price' + counter + 
	      '"/></div><div class="quantitydiv"><input name="quantity' + counter + 
	      '" type="text" id="quantity' + counter + 
	      '" class="quantity"/></div><div class="amountdiv"><input name="amount' + counter + 
	      '" id="amount' + counter + 
	      '" type="text"  class="amount"/></div><div class="addrowdiv"><img border="0" class="deleterow" src="images/cross.gif" style="display: inline; width: 18px; height: 18px;"></div>';




<div class="quantitydiv"><input name="quantity' + counter + 
	      '" type="text" id="quantity' + counter + 
	      '" class="quantity"/></div>




名称将根据计数值更改


我如何才能将JavaScript生成的txtbox值捕获到PHP中.




name will changing by count value


how can i catch that javascript generated txtbox values into PHP.

推荐答案

(' ' 点击',function( ){ if(counter> 20){ alert(" ); 返回 false; } var row = ' < div class ="itemwraprow">< div class ="slnodiv">< /div>< div class ="itemdiv"><输入名称="item' +计数器+ " id ="item' +计数器+ " type ="text" class ="itemönchange=" selectvalue3();"/></div>< div class =" partnodiv><输入名称=" partno' +计数器+ ' "type =" text"class =" partno"id =" partno' +计数器+ ' "readonly =" readonly"/></div>< div class =" pricediv>< ;输入名称="price' +计数器+ ' "id ="价格' +计数器+ ' "type =" text"class =" price"name =" price' +计数器+ ' "/></div>< div class =" quantitydiv><输入名称="数量" +计数器+ ' "type =" text"id =" quantity' +计数器+ ' "class =" quantity"/></div>< div class =" amountdiv>< ;输入名称="amount' +计数器+ ' "id =" amount' +计数器+ ' "type =" text"class =" amount"/></div>< div class =" addrowdiv>< img border =" 0"class =" deleterow"src =" images/cross.gif"style =" display:inline;宽度:18px; height:18px;></div>'; < div =" quantitydiv" < 名称 =" 类型 文本" id =" class 数量" > < /div >
('.addrownew').live('click',function(){ if(counter>20){ alert("you count has reached 15 ..please check once"); return false; } var row='<div class="itemwraprow"><div class="slnodiv"></div><div class="itemdiv"><input name="item' + counter +'" id="item' + counter +'" type="text" class="item" önchange="selectvalue3();"/></div><div class="partnodiv"><input name="partno' + counter + '" type="text" class="partno" id="partno' + counter + '" readonly="readonly" /></div><div class="pricediv"> <input name="price' + counter + '" id="price' + counter + '" type="text" class="price" name="price' + counter + '"/></div><div class="quantitydiv"><input name="quantity' + counter + '" type="text" id="quantity' + counter + '" class="quantity"/></div><div class="amountdiv"><input name="amount' + counter + '" id="amount' + counter + '" type="text" class="amount"/></div><div class="addrowdiv"><img border="0" class="deleterow" src="images/cross.gif" style="display: inline; width: 18px; height: 18px;"></div>'; <div class="quantitydiv"><input name="quantity' + counter + '" type="text" id="quantity' + counter + '" class="quantity"/></div>




名称将根据计数值更改


我如何才能将JavaScript生成的txtbox值捕获到PHP中.




name will changing by count value


how can i catch that javascript generated txtbox values into PHP.



我在ASP.net中做过同样的事情,所以我可以给你一个思路,我已经生成了下拉列表,我在提交表单时更改了生成的下拉列表的ID,并将其保存在数组中以检索每个下拉列表的值,此功能正常工作
Hi,
I have done the same thing in ASP.net so i can just give you an idea i have generated dropdown list,I am changing the ID of generated dropdown on submitting the form, and saving it in an array to retrieve value of each dropdown and this functionality is working fine


使用print_r(


这篇关于如何将JavaQuery值转换为PHP代码以保存在数据库中(MYSQL)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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