fix regex
This commit is contained in:
parent
acb3e4a8d6
commit
1b394d27ab
2 changed files with 4 additions and 4 deletions
|
@ -531,7 +531,7 @@ export class EventAuth {
|
|||
if (!editorEventId.disabled) { // Only validate if it's a new event
|
||||
if (!editorEventId.value) {
|
||||
errors.eventId = "Event ID is required";
|
||||
} else if (!editorEventId.value.match(/^[A-Za-z0-9_-]+$/)) {
|
||||
} else if (!editorEventId.value.match(/^[A-Za-z0-9_\-]+$/)) {
|
||||
errors.eventId = "Event ID can only contain letters, numbers, underscores, and hyphens";
|
||||
} else if (editorEventId.value.length < 3) {
|
||||
errors.eventId = "Event ID must be at least 3 characters";
|
||||
|
@ -552,7 +552,7 @@ export class EventAuth {
|
|||
// Event Code validation
|
||||
if (!editorEventCode.value) {
|
||||
errors.eventCode = "Event Code is required";
|
||||
} else if (!editorEventCode.value.match(/^[A-Za-z0-9_-]+$/)) {
|
||||
} else if (!editorEventCode.value.match(/^[A-Za-z0-9_\-]+$/)) {
|
||||
errors.eventCode = "Event Code can only contain letters, numbers, underscores, and hyphens";
|
||||
} else if (editorEventCode.value.length < 3) {
|
||||
errors.eventCode = "Event Code must be at least 3 characters";
|
||||
|
|
|
@ -27,7 +27,7 @@ const { editor_title, form } = config.ui.tables.events;
|
|||
id="editorEventId"
|
||||
class="input input-bordered w-full"
|
||||
placeholder={form.event_id.placeholder}
|
||||
pattern="[A-Za-z0-9_-]+"
|
||||
pattern="[A-Za-z0-9_\-]+"
|
||||
minlength="3"
|
||||
maxlength="50"
|
||||
required
|
||||
|
@ -49,7 +49,7 @@ const { editor_title, form } = config.ui.tables.events;
|
|||
id="editorEventCode"
|
||||
class="input input-bordered w-full"
|
||||
placeholder={form.event_code.placeholder}
|
||||
pattern="[A-Za-z0-9_-]+"
|
||||
pattern="[A-Za-z0-9_\-]+"
|
||||
minlength="3"
|
||||
maxlength="20"
|
||||
required
|
||||
|
|
Loading…
Reference in a new issue