0
<input class="messageCheckbox" type="checkbox" name="options[]" value="<?php echo $catrecord[0] ; ?>"/>

This is the check box and when some one select it i want to go to another url with checkbox valaue in url, not as post.

this is the place i wanna append checkbox valaue case 'Addnew':

window.location = '<?php echo JURI::base()."index.php?option=com_flatorb&view=entity"?>';
break;

3 Answers 3

2
document.[name of form].[name of checkbox].checked

or with jQuery:

$('#[id of checkbox]').is(':checked');
Sign up to request clarification or add additional context in comments.

Comments

2

You can bind change event handler with checkbox and use window.location to open page.

$('#checkboxId').change(function(){
   if(this.checked)
      window.location = 'index.php?option=com_flatorb&view=entity&chkValue=' + this.value;
});

1 Comment

You are welcome, I just checked you do not have id in checkbox, I think you need value of check and I updated my answer for value.
1

You can do something like below,

Method 1

$('.messageCheckbox').change(function(){
   if(this.checked)
      window.location = 'index.php?option=com_flatorb&view=entity&value=' + $(this).val('');
});

Method 2

$('.messageCheckbox').change(function(){
   if($('#edit-checkbox-id').is(':checked'))
      window.location = 'index.php?option=com_flatorb&view=entity&value=' + $(this).val('');
})

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.