How can I fix the above so that :
if the user selects jobseeker redirect them to
JobSeeker/jsRegistration.cshtml otherwise go to
Employer/empRegistration.cshtml
<div class="wrap">
<div class="content">
@Html.AntiForgeryToken()
<div class="botitle_h1">Are you a Job Seeker or an Employer?</div>
<form action="~/Registration/Registration" method="post">
<div class="inner-content" style="border:none">
<span><input type="radio" onclick="selecttype('jobseeker');" name="account" id="jobseeker" value="0"> I am a Job Seeker seeking WORK </span>
<span> <input type="radio" onclick="selecttype('employee');" name="account" id="employee" value="1"> I am a Company seeking to HIRE </span>
<input id="regtype" type="hidden" name="regtype" value="0" />
<span style="float:right">
<input type="submit" class="home_buttonNext" value="Next Step">
</span>
<span style="clear:both"></span>
</div>
</form>
</div>
</div>
<script>
function selecttype(type) {
if (type == 'jobseeker') {
$('#regtype').val('0');
}
else {
$('#regtype').val('1');
}
}
</script>
Anonymous User
03-Apr-2014mathieu cupryk
02-Apr-2014I am getting into this mvc.
Chris Anderson
02-Apr-2014JobSeekerController.cs
EmployerController.cs
In order to handle post requets you need to create action for post as given below:
To hadle it from the view, modify the view code as given below:
Thanks.
mathieu cupryk
01-Apr-2014I am not sure how to handle the form action?
What should I have?
mathieu cupryk
01-Apr-2014I also wanted to mention your article was really done nicely.
mathieu cupryk
01-Apr-2014This looks great and makes sense.
Should I create a controller these two controlers
JobSeekerController.cs
EmployerController .cs
?
Chris Anderson
01-Apr-2014create Controllers:
then modify your client script code as given below:
Hope this works for you.