Skip to content

Commit

Permalink
Updated form handling function to send data to api
Browse files Browse the repository at this point in the history
  • Loading branch information
XenonyxBlaze committed Jun 21, 2023
1 parent 3c39845 commit cf29c76
Showing 1 changed file with 10 additions and 9 deletions.
19 changes: 10 additions & 9 deletions index.html
Original file line number Diff line number Diff line change
Expand Up @@ -422,7 +422,7 @@ <h3>Marketing &amp; User Research</h3>
<div class="hire">
<!-- <h2>You're interested in</h2> -->
<!-- checkout formspree.io for easy form setup -->
<form class="work-request">
<form class="work-request" action="https://apollo-backend.vercel.app/api/apply" method="POST">
<div class="work-request--options">
<span class="options">
<div class="inps is-vis"></div>
Expand All @@ -447,11 +447,11 @@ <h3>Marketing &amp; User Research</h3>
</div>
<div class="work-request--information">
<div class="information-name">
<input id="name" type="text" spellcheck="false" />
<input id="name" name="name" type="text" spellcheck="false" />
<label for="name">Name</label>
</div>
<div class="information-email">
<input id="email" type="email" spellcheck="false" />
<input id="email" name="email" type="email" spellcheck="false" />
<label id="email-label" for="email">Email</label>
<script>
const email = document.getElementById("email");
Expand Down Expand Up @@ -1025,8 +1025,8 @@ <h2>The Team</h2>
var filter = /^[a-z]+.?[a-z]+202\d@vitbhopal\.ac\.in$/;
const email = $("#email")[0];
if (!filter.test(email.value)) {
alert("Please provide a valid email address");
email.focus;
alert("Please provide a vitbhopal email address");
email.focus();
return false;
}
return true;
Expand All @@ -1045,12 +1045,13 @@ <h2>The Team</h2>
alert("Please select at least one interest");
return;
}
// $("form.work-request")[0].submit();

$("form.work-request").append(
'<input type="hidden" name="interests" value="'+interests+'" />'
);
$("form.work-request")[0].submit();
}
});
// $("form.work-request")[0].onsubmit = function () {
// return checkEmail();
// };
</script>
<!-- <script src="assets/js/functions-min.js"></script> -->
<script
Expand Down

0 comments on commit cf29c76

Please sign in to comment.