Skip to content

separate event handler functions for an event attached to different inputs or one event handler function with lot of if statements/ switch statement? #1783

Open
@unitedsol

Description

@unitedsol

separate event handler functions for an event attached to different inputs or one event handler function with lot of if statements/ switch statement?

// event handler 1
function validateEmail() {
	// validate email here
}

// event handler 2
function validatePassword() {
	//validate password here
}

// or

// generic event handler
function validateFields() {
	/*
	if(is email){
		validate email
	}

	if(is password) {
		validate password
	}
	*/
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions