| | |
Help me ->very son->CheckBox
Please support our JavaScript / DHTML / AJAX advertiser: PostgreSQL or MySQL? Compare and contrast the two most popular open source databases
![]() |
•
•
Join Date: Nov 2008
Posts: 13
Reputation:
Solved Threads: 0
Hello people
i created this code:
<script langauge=javascript>
function baby(a,b)
{
document.p.text=a;
document.p.cat[b].checked=true;
}
</script>
<form name="p" >
<input type="checkbox" name="cat[10]">
<input type="checkbox" name="cat[11]">
<input type="text" name="text">
</form>
<a href="javascript:baby('Hello',10);">Click Here</a>
when i click on The "Click Here" the textbox show me Hello but the checkbox doesn't work and dosen't get check.
Now How can i do? how can i check of the checkboxes?
Another question:
you assume that i have some checkboxes with the diffrent name such as
<input type="checkbox" name="cat[110]">
<input type="checkbox" name="cat[101]">
<input type="checkbox" name="cat[011]">
.
.
.
now how can i uncheck them at a moment?
i created this code:
<script langauge=javascript>
function baby(a,b)
{
document.p.text=a;
document.p.cat[b].checked=true;
}
</script>
<form name="p" >
<input type="checkbox" name="cat[10]">
<input type="checkbox" name="cat[11]">
<input type="text" name="text">
</form>
<a href="javascript:baby('Hello',10);">Click Here</a>
when i click on The "Click Here" the textbox show me Hello but the checkbox doesn't work and dosen't get check.
Now How can i do? how can i check of the checkboxes?
Another question:
you assume that i have some checkboxes with the diffrent name such as
<input type="checkbox" name="cat[110]">
<input type="checkbox" name="cat[101]">
<input type="checkbox" name="cat[011]">
.
.
.
now how can i uncheck them at a moment?
Last edited by baby_1; Dec 6th, 2008 at 2:38 pm.
Hi,
try this
try this
JavaScript / DHTML / AJAX Syntax (Toggle Plain Text)
<html> <head> <script langauge=javascript> function baby(a,b) { document.p.text.value=a; document.getElementById(b).checked=1; } </script> </head> <body> <form name="p" > <input type="checkbox" name="cat(10)" id=10 > <input type="checkbox" name="cat(11)" id=11 > <input type="text" name="text"> </form> <a href="javascript:baby('Hello',11);">Click Here</a> </body> </html>
It is never about the number of languages you know, you either have the logic of programming or you don't ...
Some of the codes I post are collected from different sites during the past couple of years, so I would like to thank them for their help and for enabling me to help.
Some of the codes I post are collected from different sites during the past couple of years, so I would like to thank them for their help and for enabling me to help.
•
•
Join Date: Nov 2008
Posts: 13
Reputation:
Solved Threads: 0
Thanks a lot kb.net , Thank you very much ,
dear now how can i unchecked al of them with diffrent id or name at a moment? for example:
<input type="checkbox" name="cat(5)" id=5>
<input type="checkbox" name="cat(9)" id=9>
<input type="checkbox" name="cat(20)" id=20 >
<input type="checkbox" name="cat(11)" id=11 >
and how can i hide them?
dear now how can i unchecked al of them with diffrent id or name at a moment? for example:
<input type="checkbox" name="cat(5)" id=5>
<input type="checkbox" name="cat(9)" id=9>
<input type="checkbox" name="cat(20)" id=20 >
<input type="checkbox" name="cat(11)" id=11 >
and how can i hide them?
Hi,
Amend your code to look something like this
Amend your code to look something like this
JavaScript / DHTML / AJAX Syntax (Toggle Plain Text)
<html> <head> <script langauge=javascript> function baby() { for (var x= 1; x<=4 ;x++) document.getElementById(x).checked=0; } </script> </head> <body> <form name="p" > <input type="checkbox" name="cat(5)" id=1 > <input type="checkbox" name="cat(9)" id=2 > <input type="checkbox" name="cat(10)" id=3 > <input type="checkbox" name="cat(12)" id=4 > </form> <a href="javascript:baby();">Click Here</a> </body> </html>
It is never about the number of languages you know, you either have the logic of programming or you don't ...
Some of the codes I post are collected from different sites during the past couple of years, so I would like to thank them for their help and for enabling me to help.
Some of the codes I post are collected from different sites during the past couple of years, so I would like to thank them for their help and for enabling me to help.
![]() |
Similar Threads
- Processing Checkbox Information From A Form (JavaScript / DHTML / AJAX)
Other Threads in the JavaScript / DHTML / AJAX Forum
- Previous Thread: get image size and how to make changes
- Next Thread: Binary to decimal using bitwise operators
| Thread Tools | Search this Thread |
acid2 ajax ajaxcode ajaxhelp animate array automatically beta box bug calendar captchaformproblem cart checkbox child class close codes column createrange() css cursor decimal dependent design disablefirebug dom download dropdown editor element engine enter error events explorer ext file firefox focus forms frameworks google gwt gxt html htmlform ie8 iframe images index internet java javascript jawascriptruntimeerror jquery jsf jsfile jsp jump listbox masterpage math menu microsoft mimic mp4 object onmouseoutdivproblem onmouseover onreadystatechange parent pdf php player post problem progressbar prototype redirect regex runtime scale scroll search select shopping size sql text textarea toggle w3c web website window windowofwords windowsxp wysiwyg \n





