hi all,
Am new for joomla. i want to get checkbox value from the chronoform.I tried to get checkbox value. but till not get.
the orderform is the name of chronoform. can anyone help me..
thanks in advance..
regards,
THIRUAPTHY.M
Am new for joomla. i want to get checkbox value from the chronoform.I tried to get checkbox value. but till not get.
function get_check_value()
{
var c_value = "";
for (var i=0; i < document.orderform.music.length; i++)
{
if (document.orderform.music[i].checked)
{
c_value = c_value + document.orderform.music[i].value + "\n";
}
}
}
this is my java script code to get checkbox value. the orderform is the name of chronoform. can anyone help me..
thanks in advance..
regards,
THIRUAPTHY.M
Hi thirupathy,
Please post the Form HTML for the checkboxes so I can see both together.
Bob
Please post the Form HTML for the checkboxes so I can see both together.
Bob
thanks for your reply admin...
this is my html code...
thanks in advance..
regards,
THIRUPATHY.M
this is my html code...
What kind/s of music do you listen to?<br>
<input type="checkbox" name="edit" value="edit"">
Rock<br>
<input type="checkbox" name="music" id="music" value="Reggae">
Reggae<br>
<input type="checkbox" name="music" id="music" value="Pop">
Pop<br>
<input type="checkbox" name="music" id="music" value="Rap">
Rap<br>
<input type="checkbox" name="music" id="music" value="Metal">
Metal<br>
<input type="submit" onclick="get_check_value()">
thanks in advance..
regards,
THIRUPATHY.M
those code working in localhost. but in joomla only won't get the checkbox value...
regards,
THIRUPATHY.M
regards,
THIRUPATHY.M
problem solved.
while calling chronoform checkbox we need to add form name with following..
ChronoContact_formname.checkboxname.checked...
thanks chronoform forums support team.
regards,
THIRUPATHY.M
while calling chronoform checkbox we need to add form name with following..
ChronoContact_formname.checkboxname.checked...
thanks chronoform forums support team.
regards,
THIRUPATHY.M
Hi thirupathy,
All of the checkboxes have the same id (ids should be unique) so your JavaScript will have problems identifying them. I don't believe that it will automatically create an array from these results. Try this:
Bob
All of the checkboxes have the same id (ids should be unique) so your JavaScript will have problems identifying them. I don't believe that it will automatically create an array from these results. Try this:
What kind/s of music do you listen to?<br>
<input type="checkbox" name="edit" value="edit"">
<div id='music_types'>
Rock<br>
<input type="checkbox" name="music" id="music0" value="Reggae">
Reggae<br>
<input type="checkbox" name="music" id="music1" value="Pop">
Pop<br>
<input type="checkbox" name="music" id="music2" value="Rap">
Rap<br>
<input type="checkbox" name="music" id="music3" value="Metal">
Metal<br>
</div>
<input type="submit" onclick="get_check_value()">
function get_check_value()
{
var c_value = "";
var inputs = $('music_types').getElements('input');
for (var i=0; i < inputs.length; i++)
{
if (inputs[i].checked)
{
c_value += inputs[i].value + "\n";
}
}
}
Not tested and may need debugging (NB uses MooTools syntax).Bob
I am confused
What is the real code?
I am trying to get only checked values, but it comes with unchecked values too
Please post a single code that get only checked values
What is the real code?
I am trying to get only checked values, but it comes with unchecked values too
Please post a single code that get only checked values
This topic is locked and no more replies can be posted.