From 978333cad4c28d3106eca23e9a0e2b49a4abb870 Mon Sep 17 00:00:00 2001 From: "Billy.Zheng" Date: Fri, 31 May 2024 18:45:57 +0800 Subject: [PATCH] create new user add a bit js verify. --- src/pages/me/show_page.cr | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/src/pages/me/show_page.cr b/src/pages/me/show_page.cr index a975736..bee3ee8 100644 --- a/src/pages/me/show_page.cr +++ b/src/pages/me/show_page.cr @@ -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 +end +" ) label "密码", for: "user_password" @@ -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