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

これはチェックボックスであり、誰かがそれを選択すると、投稿としてではなく、URLにチェックボックスの値が含まれる別のURLに移動します。

これは、チェックボックスの値のケース「Addnew」を追加したい場所です。

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

3 に答える 3

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

またはjQueryを使用:

$('#[id of checkbox]').is(':checked');
于 2013-01-22T10:19:39.560 に答える
2

変更イベント ハンドラーをチェックボックスにバインドし、window.location を使用してページを開くことができます。

$('#checkboxId').change(function(){
   if(this.checked)
      window.location = 'index.php?option=com_flatorb&view=entity&chkValue=' + this.value;
});
于 2013-01-22T10:18:13.647 に答える
1

あなたは以下のようなことをすることができます、

方法1

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

方法2

$('.messageCheckbox').change(function(){
   if($('#edit-checkbox-id').is(':checked'))
      window.location = 'index.php?option=com_flatorb&view=entity&value=' + $(this).val('');
})
于 2013-01-22T10:32:15.710 に答える