如何将文本框值传递给复选框,在jquery中单击复选框 [英] how to pass textbox value to checkbox on checkbox click in jquery

查看:73
本文介绍了如何将文本框值传递给复选框,在jquery中单击复选框的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

大家好,

我需要调用一个jquery函数,它将文本框中的整数值分配给复选框检查..我现在有一个字符串作为值,在wordpress中的那个复选框...在复选框上单击它应该取隐藏的文本框的值...请帮助...

Hi Everyone,
I need to call a jquery function that will assign an integer value present in textbox to checkbox checked..I have a string as value now to that checkbox in wordpress...on checkbox click it should take value of textbox which is hidden...please help...

推荐答案

嗨拉迪卡,



你的问题不明确。但我仍然考虑过你的需要做了一些编程。



脚本:

Hi Radhika,

Your question is not clear.But still I have did some programming by considering your requiment.

Script:
<script type="text/javascript">


function (){


。chb)。click( function () {
if this .checked){
var txtVal =
(".chb").click(function () { if (this.checked) { var txtVal =


这篇关于如何将文本框值传递给复选框,在jquery中单击复选框的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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