* Toggle the disabled state of the next button.

This commit is contained in:
liumengyi
2023-08-03 10:06:51 +08:00
parent 1aa23165e4
commit eaeb9bda3a
2 changed files with 26 additions and 2 deletions
+21
View File
@@ -0,0 +1,21 @@
/**
* When agree checkbox change.
*
* @param event $event
* @access public
* @return void
*/
function agreeChange(event)
{
if($(event.target).prop('checked'))
{
$('.btn-install').attr('href', nextLink);
$('.btn-install').removeClass('disabled');
}
else
{
$('.btn-install').removeAttr('href');
$('.btn-install').addClass('disabled');
}
}
+5 -2
View File
@@ -11,6 +11,9 @@ declare(strict_types=1);
namespace zin;
set::zui(true);
jsVar('nextLink', inlink('step1'));
div
(
set::id('main'),
@@ -32,7 +35,7 @@ div
setClass('mt-2'),
checkbox
(
on::change(''),
on::change('agreeChange'),
set::checked(true),
html($lang->agreement),
),
@@ -42,7 +45,7 @@ div
setClass('text-center'),
btn
(
setClass('px-6'),
setClass('px-6 btn-install'),
set::url(inlink('step1')),
set::type('primary'),
$lang->install->next,