点击第一张图的add按钮,会生成一个新的表格,并会保存其选中的单选框状态,但是再点击的话因为生成的单选框name属性一样,选中的状态会被顶掉
$id = mysql_insert_id();
$head = "
";
if($formate=='standard 85x55mm'){
$result = "
standard 85x55mm
";
}else{
$result = "
";
}
if($formate=='carte double 170x55mm'){
$result.="carte double 170x55mm
}else{
$result.="carte double 170x55mm";
}
if($papier=='350g couche mat'){
<code> $result.="<td> <input name="papier" type="radio" value="350g couche mat" checked>350g couche mat<br>"; }else{ $result.="</td> <td> <input name="papier" type="radio" value="350g couche mat">350g couche mat<br>"; } if($papier=='300g offset'){ $result.="<input name="papier" type="radio" value="300g offset" checked>300g offset</td>"; }else{ $result.="<input name="papier" type="radio" value="300g offset">300g offset"; } if($imprimer=='Recto seule'){ $result.="<td> <input name="imprimer" type="radio" value="Recto seule" checked>Recto seule<br>"; }else{ $result.="</td> <td> <input name="imprimer" type="radio" value="Recto seule">Recto seule<br>"; } if($imprimer=='Recto et verso'){ $result.="<input name="imprimer" value="Recto et verso" type="radio" checked>Recto et verso</td>"; }else{ $result.="<input name="imprimer" value="Recto et verso" type="radio">Recto et verso"; } if($pelliculage=='Recto seule brillant'){ $result.= "<td> <input name="pelliculage" value="Recto seule brillant" type="radio" checked>Recto seule brillant<br>"; }else{ $result.= "</td> <td> <input name="pelliculage" value="Recto seule brillant" type="radio">Recto seule brillant<br>"; } if($pelliculage=='Recto seule mat'){ $result.="<input name="pelliculage" value="Recto seule mat" type="radio" checked>Recto seule mat<br>"; }else{ $result.="<input name="pelliculage" value="Recto seule mat" type="radio">Recto seule mat<br>"; } if($pelliculage=='Recto et verso brillant'){ $result.="<input name="pelliculage" value="Recto et verso brillant" type="radio">Recto et verso brillant<br>"; }else{ $result.="<input name="pelliculage" value="Recto et verso brillant" type="radio">Recto et verso brillant<br>"; } if($pelliculage=='Recto et verso mat'){ $result.="<input name="pelliculage" value="Recto et verso mat" type="radio" checked>Recto et verso mat<br>"; } else{ $result.="<input name="pelliculage" value="Recto et verso mat" type="radio">Recto et verso mat<br>"; } $result.="<table> <thead> <th>Id</th> <th>count</th> <th>price</th> <th>price2</th> <th>price3</th> </thead> <tbody> <td>1</td> <td><input name="count" type="text"></td> <td><input type="text" name="price1"></td> <td><input type="text" name="price2"></td> <td><input type="text" name="price3"></td> <td><button>add</button></td> </tbody> </table>"; echo $head.$result.$foot; <p><img src="/static/imghwm/default1.png" data-src="/img/bVmSW6" class="lazy" data- alt="jquery - 用php和ajax无刷新添加radio button并保存其选中的状态" ><br><img src="/static/imghwm/default1.png" data-src="/img/bVmSWG" class="lazy" data- alt="jquery - 用php和ajax无刷新添加radio button并保存其选中的状态" ></p> <p><img src="/static/imghwm/default1.png" data-src="/img/bVmSWY" class="lazy" data- alt="jquery - 用php和ajax无刷新添加radio button并保存其选中的状态" ></p> </td></code>
回复内容:
点击第一张图的add按钮,会生成一个新的表格,并会保存其选中的单选框状态,但是再点击的话因为生成的单选框name属性一样,选中的状态会被顶掉
$id = mysql_insert_id();
$head = "
";
if($formate=='standard 85x55mm'){
$result = "
standard 85x55mm
";
}else{
$result = "
";
}
if($formate=='carte double 170x55mm'){
$result.="carte double 170x55mm
}else{
$result.="carte double 170x55mm";
}
if($papier=='350g couche mat'){
<code> $result.="<td> <input name="papier" type="radio" value="350g couche mat" checked>350g couche mat<br>"; }else{ $result.="</td> <td> <input name="papier" type="radio" value="350g couche mat">350g couche mat<br>"; } if($papier=='300g offset'){ $result.="<input name="papier" type="radio" value="300g offset" checked>300g offset</td>"; }else{ $result.="<input name="papier" type="radio" value="300g offset">300g offset"; } if($imprimer=='Recto seule'){ $result.="<td> <input name="imprimer" type="radio" value="Recto seule" checked>Recto seule<br>"; }else{ $result.="</td> <td> <input name="imprimer" type="radio" value="Recto seule">Recto seule<br>"; } if($imprimer=='Recto et verso'){ $result.="<input name="imprimer" value="Recto et verso" type="radio" checked>Recto et verso</td>"; }else{ $result.="<input name="imprimer" value="Recto et verso" type="radio">Recto et verso"; } if($pelliculage=='Recto seule brillant'){ $result.= "<td> <input name="pelliculage" value="Recto seule brillant" type="radio" checked>Recto seule brillant<br>"; }else{ $result.= "</td> <td> <input name="pelliculage" value="Recto seule brillant" type="radio">Recto seule brillant<br>"; } if($pelliculage=='Recto seule mat'){ $result.="<input name="pelliculage" value="Recto seule mat" type="radio" checked>Recto seule mat<br>"; }else{ $result.="<input name="pelliculage" value="Recto seule mat" type="radio">Recto seule mat<br>"; } if($pelliculage=='Recto et verso brillant'){ $result.="<input name="pelliculage" value="Recto et verso brillant" type="radio">Recto et verso brillant<br>"; }else{ $result.="<input name="pelliculage" value="Recto et verso brillant" type="radio">Recto et verso brillant<br>"; } if($pelliculage=='Recto et verso mat'){ $result.="<input name="pelliculage" value="Recto et verso mat" type="radio" checked>Recto et verso mat<br>"; } else{ $result.="<input name="pelliculage" value="Recto et verso mat" type="radio">Recto et verso mat<br>"; } $result.="<table> <thead> <th>Id</th> <th>count</th> <th>price</th> <th>price2</th> <th>price3</th> </thead> <tbody> <td>1</td> <td><input name="count" type="text"></td> <td><input type="text" name="price1"></td> <td><input type="text" name="price2"></td> <td><input type="text" name="price3"></td> <td><button>add</button></td> </tbody> </table>"; echo $head.$result.$foot; <p><img src="/static/imghwm/default1.png" data-src="/img/bVmSW6" class="lazy" data- alt="jquery - 用php和ajax无刷新添加radio button并保存其选中的状态" ><br><img src="/static/imghwm/default1.png" data-src="/img/bVmSWG" class="lazy" data- alt="jquery - 用php和ajax无刷新添加radio button并保存其选中的状态" ></p> <p><img src="/static/imghwm/default1.png" data-src="/img/bVmSWY" class="lazy" data- alt="jquery - 用php和ajax无刷新添加radio button并保存其选中的状态" ></p> </td></code>
为啥不生成name不一样的?

PHP在电子商务、内容管理系统和API开发中广泛应用。1)电子商务:用于购物车功能和支付处理。2)内容管理系统:用于动态内容生成和用户管理。3)API开发:用于RESTfulAPI开发和API安全性。通过性能优化和最佳实践,PHP应用的效率和可维护性得以提升。

PHP可以轻松创建互动网页内容。1)通过嵌入HTML动态生成内容,根据用户输入或数据库数据实时展示。2)处理表单提交并生成动态输出,确保使用htmlspecialchars防XSS。3)结合MySQL创建用户注册系统,使用password_hash和预处理语句增强安全性。掌握这些技巧将提升Web开发效率。

PHP和Python各有优势,选择依据项目需求。1.PHP适合web开发,尤其快速开发和维护网站。2.Python适用于数据科学、机器学习和人工智能,语法简洁,适合初学者。

PHP仍然具有活力,其在现代编程领域中依然占据重要地位。1)PHP的简单易学和强大社区支持使其在Web开发中广泛应用;2)其灵活性和稳定性使其在处理Web表单、数据库操作和文件处理等方面表现出色;3)PHP不断进化和优化,适用于初学者和经验丰富的开发者。

PHP在现代Web开发中仍然重要,尤其在内容管理和电子商务平台。1)PHP拥有丰富的生态系统和强大框架支持,如Laravel和Symfony。2)性能优化可通过OPcache和Nginx实现。3)PHP8.0引入JIT编译器,提升性能。4)云原生应用通过Docker和Kubernetes部署,提高灵活性和可扩展性。

PHP适合web开发,特别是在快速开发和处理动态内容方面表现出色,但不擅长数据科学和企业级应用。与Python相比,PHP在web开发中更具优势,但在数据科学领域不如Python;与Java相比,PHP在企业级应用中表现较差,但在web开发中更灵活;与JavaScript相比,PHP在后端开发中更简洁,但在前端开发中不如JavaScript。

PHP和Python各有优势,适合不同场景。1.PHP适用于web开发,提供内置web服务器和丰富函数库。2.Python适合数据科学和机器学习,语法简洁且有强大标准库。选择时应根据项目需求决定。

PHP是一种广泛应用于服务器端的脚本语言,特别适合web开发。1.PHP可以嵌入HTML,处理HTTP请求和响应,支持多种数据库。2.PHP用于生成动态网页内容,处理表单数据,访问数据库等,具有强大的社区支持和开源资源。3.PHP是解释型语言,执行过程包括词法分析、语法分析、编译和执行。4.PHP可以与MySQL结合用于用户注册系统等高级应用。5.调试PHP时,可使用error_reporting()和var_dump()等函数。6.优化PHP代码可通过缓存机制、优化数据库查询和使用内置函数。7


热AI工具

Undresser.AI Undress
人工智能驱动的应用程序,用于创建逼真的裸体照片

AI Clothes Remover
用于从照片中去除衣服的在线人工智能工具。

Undress AI Tool
免费脱衣服图片

Clothoff.io
AI脱衣机

AI Hentai Generator
免费生成ai无尽的。

热门文章

热工具

Dreamweaver CS6
视觉化网页开发工具

螳螂BT
Mantis是一个易于部署的基于Web的缺陷跟踪工具,用于帮助产品缺陷跟踪。它需要PHP、MySQL和一个Web服务器。请查看我们的演示和托管服务。

DVWA
Damn Vulnerable Web App (DVWA) 是一个PHP/MySQL的Web应用程序,非常容易受到攻击。它的主要目标是成为安全专业人员在合法环境中测试自己的技能和工具的辅助工具,帮助Web开发人员更好地理解保护Web应用程序的过程,并帮助教师/学生在课堂环境中教授/学习Web应用程序安全。DVWA的目标是通过简单直接的界面练习一些最常见的Web漏洞,难度各不相同。请注意,该软件中

MinGW - 适用于 Windows 的极简 GNU
这个项目正在迁移到osdn.net/projects/mingw的过程中,你可以继续在那里关注我们。MinGW:GNU编译器集合(GCC)的本地Windows移植版本,可自由分发的导入库和用于构建本地Windows应用程序的头文件;包括对MSVC运行时的扩展,以支持C99功能。MinGW的所有软件都可以在64位Windows平台上运行。

SecLists
SecLists是最终安全测试人员的伙伴。它是一个包含各种类型列表的集合,这些列表在安全评估过程中经常使用,都在一个地方。SecLists通过方便地提供安全测试人员可能需要的所有列表,帮助提高安全测试的效率和生产力。列表类型包括用户名、密码、URL、模糊测试有效载荷、敏感数据模式、Web shell等等。测试人员只需将此存储库拉到新的测试机上,他就可以访问到所需的每种类型的列表。