Link to home
Create AccountLog in
Avatar of garethtnash
garethtnashFlag 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!
ASKER CERTIFIED SOLUTION
Avatar of Duy Pham
Duy Pham
Flag of Viet Nam image

Link to home
membership
Create an account to see this answer
Signing up is free. No credit card required.
Create Account
Avatar of garethtnash

ASKER

Thank you