{"id":228,"date":"2010-04-15T12:54:30","date_gmt":"2010-04-15T17:54:30","guid":{"rendered":"http:\/\/www.cfchimp.com\/wordpress\/?p=228"},"modified":"2024-12-05T12:09:03","modified_gmt":"2024-12-05T17:09:03","slug":"use-jquery-to-enable-submit-button-and-set-form-action","status":"publish","type":"post","link":"https:\/\/csimmons.dev\/blog\/2010\/04\/use-jquery-to-enable-submit-button-and-set-form-action\/","title":{"rendered":"Use jQuery to enable submit button and set form action"},"content":{"rendered":"<p>I recently had to do a quick bit of coding to only accept data from a form if JavaScript was enabled.<\/p>\n<p>This example starts with a form that has no action and a disabled submit button.\u00a0 When jQuery&#8217;s .ready() fires though it enables the submit button and attaches the appropriate action.<\/p>\n<p>Please note the example file is in ColdFusion so your mileage may vary slightly for your own use.<\/p>\n<p><a href=\"http:\/\/www.cfchimp.com\/chimpsamples\/jquery-enabled-form.cfm\" target=\"_blank\">See it here<\/a> | <a href=\"https:\/\/csimmons.dev\/blog\/wp-content\/uploads\/2010\/04\/jquery-enabled-form.cfm_.zip\">Get it here<\/a>.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>I recently had to do a quick bit of coding to only accept data from a form if JavaScript was enabled. This example starts with a form that has no action and a disabled submit button.\u00a0 When jQuery&#8217;s .ready() fires though it enables the submit button and attaches the appropriate action. Please note the example &#8230; <a title=\"Use jQuery to enable submit button and set form action\" class=\"read-more\" href=\"https:\/\/csimmons.dev\/blog\/2010\/04\/use-jquery-to-enable-submit-button-and-set-form-action\/\" aria-label=\"Read more about Use jQuery to enable submit button and set form action\">Read more<\/a><\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_exactmetrics_skip_tracking":false,"_exactmetrics_sitenote_active":false,"_exactmetrics_sitenote_note":"","_exactmetrics_sitenote_category":0,"_cloudinary_featured_overwrite":false,"_jetpack_newsletter_access":"","_jetpack_dont_email_post_to_subs":false,"_jetpack_newsletter_tier_id":0,"_jetpack_memberships_contains_paywalled_content":false,"_jetpack_memberships_contains_paid_content":false,"footnotes":""},"categories":[68],"tags":[48,26,28],"class_list":["post-228","post","type-post","status-publish","format-standard","hentry","category-developer","tag-coldfusion","tag-javascript","tag-jquery"],"jetpack_featured_media_url":"","jetpack_shortlink":"https:\/\/wp.me\/pbVg43-3G","jetpack_sharing_enabled":true,"_links":{"self":[{"href":"https:\/\/csimmons.dev\/blog\/wp-json\/wp\/v2\/posts\/228","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/csimmons.dev\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/csimmons.dev\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/csimmons.dev\/blog\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/csimmons.dev\/blog\/wp-json\/wp\/v2\/comments?post=228"}],"version-history":[{"count":0,"href":"https:\/\/csimmons.dev\/blog\/wp-json\/wp\/v2\/posts\/228\/revisions"}],"wp:attachment":[{"href":"https:\/\/csimmons.dev\/blog\/wp-json\/wp\/v2\/media?parent=228"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/csimmons.dev\/blog\/wp-json\/wp\/v2\/categories?post=228"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/csimmons.dev\/blog\/wp-json\/wp\/v2\/tags?post=228"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}