Skip to content

Commit

Permalink
create new user add a bit js verify.
Browse files Browse the repository at this point in the history
  • Loading branch information
zw963 committed May 31, 2024
1 parent 4d97c41 commit 978333c
Showing 1 changed file with 12 additions and 2 deletions.
14 changes: 12 additions & 2 deletions src/pages/me/show_page.cr
Original file line number Diff line number Diff line change
Expand Up @@ -185,7 +185,12 @@ end
input(
type: "text",
name: "user:email",
id: "user_email"
id: "user_email",
script: "on change set x to me.value
then if x != ''
remove @disabled from <a#create_new_user/>
end
"
)

label "密码", for: "user_password"
Expand Down Expand Up @@ -229,7 +234,12 @@ end
"hx-target": "body",
"hx-include": "[name='_csrf'],[name='user:password'],[name='user:password_confirmation'],[name='user:email']",
id: "create_new_user",
disabled: "disabled"
disabled: "disabled",
script: "on mouseover set x to (<#user_email/>).value
then if x == ''
set @disabled of me to 'disabled'
end
"
)
end
end
Expand Down

0 comments on commit 978333c

Please sign in to comment.