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.disabled) { // Only validate if it's a new event
|
||||||
if (!editorEventId.value) {
|
if (!editorEventId.value) {
|
||||||
errors.eventId = "Event ID is required";
|
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";
|
errors.eventId = "Event ID can only contain letters, numbers, underscores, and hyphens";
|
||||||
} else if (editorEventId.value.length < 3) {
|
} else if (editorEventId.value.length < 3) {
|
||||||
errors.eventId = "Event ID must be at least 3 characters";
|
errors.eventId = "Event ID must be at least 3 characters";
|
||||||
|
@ -552,7 +552,7 @@ export class EventAuth {
|
||||||
// Event Code validation
|
// Event Code validation
|
||||||
if (!editorEventCode.value) {
|
if (!editorEventCode.value) {
|
||||||
errors.eventCode = "Event Code is required";
|
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";
|
errors.eventCode = "Event Code can only contain letters, numbers, underscores, and hyphens";
|
||||||
} else if (editorEventCode.value.length < 3) {
|
} else if (editorEventCode.value.length < 3) {
|
||||||
errors.eventCode = "Event Code must be at least 3 characters";
|
errors.eventCode = "Event Code must be at least 3 characters";
|
||||||
|
|
|
@ -27,7 +27,7 @@ const { editor_title, form } = config.ui.tables.events;
|
||||||
id="editorEventId"
|
id="editorEventId"
|
||||||
class="input input-bordered w-full"
|
class="input input-bordered w-full"
|
||||||
placeholder={form.event_id.placeholder}
|
placeholder={form.event_id.placeholder}
|
||||||
pattern="[A-Za-z0-9_-]+"
|
pattern="[A-Za-z0-9_\-]+"
|
||||||
minlength="3"
|
minlength="3"
|
||||||
maxlength="50"
|
maxlength="50"
|
||||||
required
|
required
|
||||||
|
@ -49,7 +49,7 @@ const { editor_title, form } = config.ui.tables.events;
|
||||||
id="editorEventCode"
|
id="editorEventCode"
|
||||||
class="input input-bordered w-full"
|
class="input input-bordered w-full"
|
||||||
placeholder={form.event_code.placeholder}
|
placeholder={form.event_code.placeholder}
|
||||||
pattern="[A-Za-z0-9_-]+"
|
pattern="[A-Za-z0-9_\-]+"
|
||||||
minlength="3"
|
minlength="3"
|
||||||
maxlength="20"
|
maxlength="20"
|
||||||
required
|
required
|
||||||
|
|
Loading…
Reference in a new issue