Depends, will the form work with AJAX turned off?
If so use an input and degrade gracefully.
Otherwise, define nonces used by JS using JS for consistency, and to prevent grabbing stuff from the DOM
Related Posts:
- How does nonce verification work?
- How to expire a nonce?
- Fatal error: Call to undefined function wp_create_nonce()
- How to add/retrieve the post trash link?
- Using nonce external of WP Admin
- “The link you followed has expired” when previewing a post
- wp_verify_nonce keeps failing
- Handling nonce generation in AJAX registration process
- increase nonce lifespan
- wp_verify_nonce() via REST always returns false
- Nonce failing in IE
- Nonces, AJAX, script variables & security in WordPress
- my theme breaks WP export
- Why am I getting a 403 from check_admin_referer()?
- how to send Ajax request in wordpress backend
- x-wp-nonce across domains
- wp_create_nonce doesn’t verify when using WP_List_Table
- Handling expired nonces
- What is really “wp_nonce_field” and how does it work? [duplicate]
- Cannot verify nonce
- wp_verify_nonce return false despite correct parameter passed
- WordPress JSON API nonces and Vue development server
- Verify a nonce in Form submission
- phpcs error in WordPress
- Stop WordPress nonces expiring
- Several nonces?
- Nonce for Trashing Item
- Nonce keeps failing
- Public posts – preventing duplicate form submissions
- How to obtain “wp_rest” nonce for WP Statistics plugin manually?
- WordPress “nonce” message
- CSP nonces with Cloudflare Workers
- Why are nonces working in Firefox but not in Chrome?
- wp_verfy_nonce keeps giving false
- Nonce – reissue with ajax poll
- wp_nonce_url generating invalid links
- How to insert wp_nonce field within echoed string
- Nonce check causing issues when creating new post
- WordPress wp_localize_script nonce and ajax URL
- Weird nonce validation problem
- Logout button in menu without “wp” in links
- Check nonce in the new bulk_edit_posts action
- nonce de sécurité invalide
- Is it possible to use wp_localize_script to create global JS variables without a specific script handle?
- wp_verify_nonce vs check_admin_referer
- Do I need a nonce field for every meta box I add to my custom post type admin?
- Can I use the same nonce for multiple requests on the same page?
- How to get a unique nonce for each Ajax request?
- Nonce retrieved from the REST API is invalid and different from nonce generated in wp_localize_script
- Are Nonces Useless?
- How to intercept already localized scripts
- How to use nonce with front end submission form?
- Is there a JavaScript API? How to access public and private data in JS?
- Extend WordPress (4.x) session and nonce
- Passing boolean values with wp_localize_script
- What is the correct way to build a widget using OOP
- Nonces can be reused multiple times? Bug / Security issue?
- Multiple wp_localize_script
- Creating Multiple wp_localize_script for Shortcode?
- How do WordPress Nonces Work?
- Nonces and Cache
- How do I create a user using the new JSON api in 4.7?
- AJAX nonce with check_ajax_referer()
- Verify nonce in REST API?
- Is wp_nonce_field vulnerable if you know the action name?
- Using nonce in menu item
- Do I need to escape data passed to wp_localize_script()?
- Is it safe to assume that a nonce may be validated more than once?
- w3 total cache minification breaks wp_localize_script() [closed]
- Multiple ajax nonce requests
- What is nonce and how to use it with Ajax in WordPress? [duplicate]
- Do I require the use of nonce?
- Getting “The link you followed has expired” when adding custom post [closed]
- Should nonce be sanitized?
- wp_localized_script is not defined when called via jquey ajax
- Nonce in settings API with tabbed navigation
- Using Nonces for AJAX that only retrieves data
- WordPress REST API call generates nonce twice on every call
- WordPress “Link has expired” error on updating posts
- How to verify nonce from Bulk/Quick Edit in save_post?
- wp_localize_script with boolean and init
- wp_localize_script $handle
- enqueue and localize script in footer
- Handling nonces for actions from guests to logged-in users
- How to add WordPress nonces to ajax request
- Can I verify nonce which was generated on a different WP site?
- Use wp_localize_script for non existing script
- WordPress failure when logging out
- Reduce nonce lifespan
- Security – Ajax and Nonce use [closed]
- Headless WordPress: How to authenticate front end requests?
- Nonces and Ajax request to REST API and verification
- How to stop _wpnonce and _wp_http_referer from appearing in URL
- How to add extra attributes to the script tag added via wp_localize_script()
- Localize variable for multiple Shortcodes
- jQuery Autocomplete not working with wp_localize_script
- Problem in wp_localize_script
- Ajax function returns -1
- Undefined index: at_nonce in custom post metabox
- Passing PHP Variables to JS using Localize Script