Skip to Content
NFSFU234FormValidation v3 is here — file upload validation, config-driven rules, and more.
v2 (legacy)redirect

redirect

The redirect function navigates the browser to a specified URL. Optionally, you can provide a delay (in milliseconds) before the redirection occurs. If no delay is specified, the redirection happens immediately. If the URL is null or false, no redirection occurs.

Works in: React JS, HTML5

ParameterTypeDefaultDescription
urlstring | null | falsenullThe URL to which the browser should navigate.
delaynumber0Optional delay before redirection in milliseconds.

Usage

Example: Redirect to a URL

const url = "https://www.example.com"; nfsfu234FormValidation.redirect(url); // Redirects immediately to the specified URL const delayedUrl = "https://www.example.com"; nfsfu234FormValidation.redirect(delayedUrl, 3000); // Redirects to the specified URL after 3 seconds

See also

Last updated on