Avatar of garethtnash
garethtnash
Flag for United Kingdom of Great Britain and Northern Ireland asked on

Query Prevent Form Submit if Javascript disabled

Hello All,

I'm trying to prevent forms being submitted if javascript is disabled, I have targeted my submit button like -

<input name="Personal Statement" type="submit" disabled="disabled" class="submitBtn" id="PersonalStatementSubmit" form="Personal_Statement" value="Save">

Open in new window


And then my JQuery is -

$(function(){
  $('#PersonalStatementSubmit').attr('disabled', false);
  $('#EditPersonalStatementSubmit').attr('disabled', false);
  $("#EditPersonalStatementSubmit").prop("disabled",!$("#EditPersonalStatementSubmit").prop("disabled"))
  $('#SkillsandExpertiseSubmit').attr('disabled', false);
  $('#AvailabilitySubmit').attr('disabled', false);
  $('#EditWorkHistorySubmit').attr('disabled', false);
  $('#WorkHistorySubmit').attr('disabled', false);
  $('#GCSESubmit').attr('disabled', false);
  $('#QualificationSubmit').attr('disabled', false);
  $('#AlevelSubmit').attr('disabled', false);
  $('#DegreeSubmit').attr('disabled', false);
  $('#MastersSubmit').attr('disabled', false);
  $('#PHDSubmit').attr('disabled', false);
  $('#OtherSubmit').attr('disabled', false);
  $('#CoveringLetterSubmit').attr('disabled', false);
  $('#EditCoveringLetterSubmit').attr('disabled', false);
  $('#CVSubmit').attr('disabled', false);
});

Open in new window


But this isn't working the page is loading with all submit buttons disabled, even when javascript is enabled...

Help!
jQueryJavaScriptHTML

Avatar of undefined
Last Comment
garethtnash

8/22/2022 - Mon
ASKER CERTIFIED SOLUTION
Duy Pham

THIS SOLUTION ONLY AVAILABLE TO MEMBERS.
View this solution by signing up for a free trial.
Members can start a 7-Day free trial and enjoy unlimited access to the platform.
See Pricing Options
Start Free Trial
GET A PERSONALIZED SOLUTION
Ask your own question & get feedback from real experts
Find out why thousands trust the EE community with their toughest problems.
garethtnash

ASKER
Thank you
This is the best money I have ever spent. I cannot not tell you how many times these folks have saved my bacon. I learn so much from the contributors.
rwheeler23