Kinda lost in the sauce here...pretty green coming into the ASP.net realm, but have been enjoying my time in it so far.
So let me start from the beginning with this:
Background: I am working on a ASP.net MVC5 application with user login informtion. The user will create an account, recieve messages, etc. The critical component is that there will be a form on the site that allows the user to submit information in a Conditional Logic HTML Form complete with radio buttons, text areas and more. My end goal is to allow the user to fill out and submit the form, therefore submitting it to the MySQL database, sending an email to admin and the user with their selected elements and then populating their responses within their "Account Dashboard" area.
Problem: I am trying to get the user submitted information based on their radio button selection in the HTML Form, which would come in 3 different scenarios:
Web Project
2D Design Project
3D Design Project
So if the user chooses "Web" instead of "Graphic" in the "Project Type" form field, they would be submitting only values related to "Web". The problem I am running into is not being sure on the best way to accomplish this...
Here's the code I've started creating for when the user chooses a Web project for submission to the database:
if (IsPost) && (RadioButton.projectType.Equals(Web))
{
projectType = Request.Form["Web"];
TypeOfWebsite = Request.Form["TypeOfWebsite"];
DeviceExperience = Request.Form["DeviceExperience"];
}
Here is the form values:
<form method="post">
<br />
<div class="row">
<label class="formquestion col-md-3">Project Name:</label>
<input class="col-md-9" type="text" placeholder="Enter project name..." />
</div>
<div class="row">
<label id="ProjectType" for="ProjectType" class="formquestion col-md-3">Project Type: </label>
<span class="col-md-8">
<input id="Web" name="ProjectType" type="radio" value="#Request.Form["Web"] value=" web" />
<label for="Web">Web</label>
<input id="Graphic" name="ProjectType" type="radio" value="Graphic" />
<label for="Graphic">Graphic</label>
</span>
</div>
<div class="hidefield" id="WebProject">
<div class="row">
<label class="formquestion col-md-3">Type Of Website: </label>
<span class="col-md-8">
<input id="WebApplication" name="TypeOfWebsite" type="radio" value="1" />
<label class="Web Application" for="Web Application">Web Application*</label>
<input id="eCommerce" name="TypeOfWebsite" type="radio" />
<label class="choice" for="eCommerce">eCommerce</label>
<input id="SocialNetwork" name="TypeOfWebsite" type="radio" />
<label class="choice" for="SocialNetwork">Social Network</label>
<input id="Forum" name="TypeOfWebsite" type="radio" />
<label class="choice" for="Forum">Forum</label>
<input id="PackageDesign" name="TypeOfWebsite" type="radio" />
<label class="choice" for="PackageDesign">News/Article</label>
<input id="Interactive" name="TypeOfWebsite" type="radio" />
<label class="choice" for="Interactive">Interactive</label>
<input id="InformationalPersonal" name="TypeOfWebsite" type="radio" />
<label class="choice" for="InformationalPersonal">Informational/Personal</label>
<p>*Not exactly sure what a web application is? Well...think TurboTax, Zamzar, Mint, Online Banking Services, MailChimp and Google Docs. </p>
</span>
</div>
<div class="row">
<label class="formquestion col-md-3" for="DeviceExperience">Device Experience: </label>
<span class="col-md-8">
<input id="Desktop" name="DeviceExperience" type="radio" value="1" />
<label for="Desktop">Desktop</label>
<input id="Tablet" name="DeviceExperience" type="radio" />
<label for="Tablet">Tablet</label>
<input id="Mobile" name="DeviceExperience" type="radio" />
<label for="Mobile">Mobile</label>
<input id="Responsive" name="DeviceExperience" type="radio" />
<label for="Responsive">Responsive</label>
</span>
</div>
</div>
<div class="hidefield" id="GraphicDimensions">
<div class="row">
<label class="formquestion col-md-3">Design Dimensions: </label>
<span class="col-md-8">
<input id="2D" name="Dimension" type="radio" value="2D" />
<label class="choice" for="Web">2D</label>
<input id="3D" name="Dimension" type="radio" value="3D" />
<label for="3D">3D</label>
</span>
</div>
</div>
<div class="hidefield" id="2DGraphicProject">
<div class="row">
<label class="formquestion col-md-3">Choose 2D Design: </label>
<span class="col-md-8">
<input id="BusinessCard" name="2DDesign" type="radio" value="1" />
<label class="BusinessCard" for="BusinessCard">Business Card</label>
<input id="Flyer" name="2DDesign" type="radio" />
<label class="choice" for="Flyer">Flyer</label>
<input id="Poster" name="2DDesign" type="radio" />
<label class="choice" for="Poster">Poster</label>
<input id="PrintAd" name="2DDesign" type="radio" />
<label class="choice" for="PrintAd">Print Ad</label>
<input id="PackageDesign" name="2DDesign" type="radio" />
<label class="choice" for="PackageDesign">Package Design (Food/Product/Media)</label>
<input id="Logo" name="Logo" type="radio" />
<label class="choice" for="Logo">Logo</label>
</span>
</div>
</div>
<div class="hidefield" id="hide3DDesignExplaination">
<div class="row">
<label class="formquestion col-md-3" for="3DDesign">Explain this 3D Design project: </label>
<textarea id="3DDesignExplaination" name="3DDesignExplaination" class="textareaform"></textarea>
</div>
</div>
<div class="hidefield" id="ProjectObjective">
<div class="row">
<label class="formquestion col-md-3" for="Objective">Project Objective:</label>
<textarea id="ObjectiveExplaination" name="ObjectiveExplaination" class="textareaform" placeholder="What is this website's primary objective? Sell me on it!"></textarea>
</div>
</div>
<div class="hidefield" id="DesignCopy">
<div class="row">
<label class="formquestion col-md-3" for="DesignCopy">Design Copy </label>
<textarea id="DesignCopy" name="DesignCopy" class="textareaform" placeholder="Any messeging/text/info needed to be included?"></textarea>
</div>
</div>
<div class="hidefield" id="TargetAudience">
<div class="row">
<label class="formquestion col-md-3" for="TargetAudience">Describe Your Target Audience:</label>
<textarea id="TargetAudienceExplaination" name="TargetAudienceExplaination" class="textareaform" placeholder="Who is your target audience? What are their ages? What do they do for a living? Elaborate!"></textarea>
</div>
</div>
<div class="hidefield" id="Keywords">
<div class="row">
<label class="formquestion col-md-3">Keywords To Describe This Project:</label>
<input class="col-md-9" type="text" placeholder="Give me 3 keywords!">
</div>
</div>
<div class="hidefield" id="FirstInteraction">
<div class="row">
<label class="formquestion col-md-3" for="UserFirstInteraction">User First Interaction:</label>
<textarea id="UserFirstInteraction" name="UserFirstInteraction" class="textareaform" placeholder="What Should The User Do First Upon Visiting The Website?"></textarea>
</div>
</div>
<div class="hidefield" id="General2">
<div class="row">
<label class="formquestion col-md-3" for="FavoriteColors">3 Favorite Colors?</label>
<input type="text" class="a-popup" data-color-format="hex" value="GreenYellow">
<input type="text" class="a-popup" data-color-format="hex" value="GreenYellow">
<input type="text" class="a-popup" data-color-format="hex" value="GreenYellow">
<small>Hint: you can type in any CSS color (even named ones, like yellow).</small>
</p>
</div>
<div class="hidefield" id="Necessities">
<div class="row">
<label class="formquestion col-md-3" for="UserFirstInteraction">Necessities:</label>
<textarea id="DesignCopy" name="ProjectReason" class="textareaform" placeholder="What are necessities for this project? Specific graphic/sitefunctionalities?"></textarea>
</div>
</div>
<h5 class="bkgblack center-align col-md-11">Provide URL's of Site/Graphics (whatever is applicable) that design you admire</h5>
<div class="row">
<label class="formquestion col-md-3" for="AdmireURL1">URL #1: </label>
<input id="AdmireURL1" name="AdmireURL1" type="text" maxlength="255" title="" value="http://" />
</div>
<div class="row">
<label class="formquestion col-md-3" for="AdmireURL2">URL #2: </label>
<input id="AdmireURL2" name="AdmireURL2" type="text" maxlength="255" title="" value="http://" />
</div>
<div class="row">
<label class="formquestion col-md-3" for="AdmireURL3">URL #3: </label>
<input id="AdmireURL3" name="AdmireURL3" type="text" maxlength="255" title="" value="http://" />
</div>
<div class="hidefield" id="RivalURL">
<h5 class="bkgblack center-align col-md-11">Provide URL's for "competitor" sites:</h5>
<div class="row">
<label class="formquestion col-md-3" for="RivalURL1">Rival URL #1: </label>
<input id="RivalURL1" name="RivalURL1" type="text" maxlength="255" title="" value="http://" />
</div>
<div class="row">
<label class="formquestion col-md-3" for="RivalURL2">Rival URL #2: </label>
<input id="RivalURL2" name="RivalURL2" type="text" maxlength="255" title="" value="http://" />
</div>
<div class="row">
<label class="formquestion col-md-3" for="RivalURL3">Rival URL #3: </label>
<input id="RivalURL3" name="RivalURL3" type="text" maxlength="255" title="" value="http://" />
</div>
</div>
</div>
<br />
<div class="hidefield" id="ProjectReason">
<div class="row">
<label class="formquestion col-md-3" for="UserFirstInteraction">Project Reason:</label>
<textarea id="DesignCopy" name="ProjectReason" class="textareaform" placeholder="Why does your target audience NEED this project to exist?"></textarea>
</div>
</div>
<div class="row">
<form action="file-upload.php" class="dropzone"></form>
</div>
<button type="submit" name="SubmitForm" class="btn btn-info btn-large">Submit Form</button>
</form>
The various MSDN tutorials I have been looking at to better understand:
http://www.asp.net/web-pages/tutorials/introducing-aspnet-web-pages-2/form-basics
http://msdn.microsoft.com/en-us/library/system.web.ui.webcontrols.radiobutton.aspx
These tutorials haven't made it clear to me on how to create these essential 3 conditional statements for my form:
"If user has chosen Project Type = "Web" and submitted the form, send (insert form variables) to the database"
"If user has chosen Project Type = "Graphic" then Dimension = "2D" and submitted the form, send (insert relative values) to the database"
"If user has chosen Project Type = "Graphic", then Dimension = "3D" and submitted the form, send (insert relative values)" to the database"
Recap:
How do I write the conditional statement to accomplish this?
Should I reconsider the HTML form format I am using in favor of ASP Web Pages?
I have written some JavaScript to show the available form values based upon user selection to follow this schema using the "value" of each field. It works just as intended! Now I'm just trying to connect dots on how to submit this information to the database so I can use it in the user profile. Any thoughts/answers would be greatly welcomed!
That's a complex form. But, for the sake of simplicity I will reduce the number of fields in your form to give you an idea of how things are the MVC way.
I'll start by pointing out that you are not taking the full advantage of MVC. It stands for Model-View-Controller, which is a design pattern. You probably know that stuff, but, I don't see a hint in your code that tells me you are using models in your project, you don't have to...but since you are starting with MVC you should. So, suppose you have the following models...
public class ProjectTypeModel
{
public string Name { get; set; }
}
public class TestModel
{
public IList<ProjectTypeModel> Types { get; set; }
}
Then you're view declares that same model...
#model MvcTest.Models.TestModel
This goes on the top of the view file, the first line of code. The simplified form would look like this...
#using(Html.BeginForm("ProcessTypes","Home")){
<div class="row">
<label class="formquestion col-md-3">Project Type: </label>
<span class="col-md-8">
#foreach (var p in Model.Types)
{
<input id="#("radio_" + p.Name)" type="radio" name="SelectedProjectType" value="#p.Name" />
<label for="#("radio_" + p.Name)">#p.Name</label>
}
</span>
</div>
<input type="submit" name="SubmitForm" class="btn btn-info btn-large" value="Submit Form" />
}
The only thing to note here is that the radio buttons MUST have the same name. The id is not too relevant, just make them unique so you can set the label's for attribute, this way when you click the label the radio button will change its state. The last thing to notice is the form is posting to the "ProcessTypes" action of the Home controller...
and your Home controller's action will look something similar to this...
public ActionResult ProcessTypes(string SelectedProjectType)
{
//processing here...
}
Obviously, the SelectedProjectType will have come with the value of the radio button you selected..."Web" or "Design".
Even though this is a very simplified example you can get an idea of how things work in MVC (and Razor). There's a bit more to cover but I'm sure you will find out by yourself.
Hope it makes sense
Related
I am using puppeteer in trying to find the selector for a login page.
the login html is:
<form action="/login?app=LM&var=au" method="POST" name="login-form" id="login-form">
<input type="hidden" name="_csrf" value="BQ2YoR3d-5P__6b5HfqlVOjv8YgTypKV92XA" />
<div class="form-group text-center">
<input type="text" name="username" id="login-form-username" placeholder="Username" class="form-control" required value="">
</div>
<div class="form-group text-center">
<input type="password" name="password" id="login-form-password" placeholder="Password" class="form-control" required>
</div>
<div class="text-center">
<button type="submit" class="btn btn-danger btn-lg btn-block">Login</button>
</div>
</form>
I tried #submit, #login-form-submit and several others for the selector. what would the selector for the login button be as there is no ID name?
i am using ClickAsync();
Either give your submit button an id property and use the #submit selector you previously tried:
<button id="submit" type="submit" class="btn btn-danger btn-lg btn-block">Login</button>
Or use form button[type=submit] as selector.
I want to make a form with two pages for a models class Student. I am currently trying to pass the data from first page into a controller which will pass the student as a model to my second page view which will then pass to the controller to save to my database but only the data from the second page is being saved to DB.
Page 1
#model Student
<body>
<div class="container1">
<form asp-action="Page2" method="post" role="form">
<div class=" form-group row">
<label asp-for="FirstName" class="col-md-2 control-label"></label>
<div class="col-md-5">
<input asp-for="FirstName" class="form-control" />
</div>
</div>
<div class="form-group row">
<div class="col-md-offset-2 col-md-5">
<input type="submit" class="btn btn-primary" value="Next" />
</div>
</div>
Page 2
#model Student
<body>
<div class="container1">
<form asp-action="Submit" method="post" role="form">
<div class=" form-group row">
<label asp-for="LastName" class="col-md-2 control-label"></label>
<div class="col-md-5">
<input asp-for="LastName" class="form-control" />
</div>
</div>
<div class="form-group row">
<div class="col-md-offset-2 col-md-5">
<input type="submit" class="btn btn-primary" value="Next" />
</div>
</div>
Controller
[HttpPost]
public IActionResult Page2(Reports report)
{
return View(report);
}
[HttpPost]
public IActionResult Submit(Reports report)
{
_reportRepository.CreateReport(report);
return View(report);
}
You need to add a form field for FirstName to the view for Page2, either a hidden field or (assuming you don't want it modified) a read-only input.
<input asp-for="FirstName" type="hidden" />
or
<input asp-for="FirstName" type="text" readonly />
Only values that have some sort of successful control are included in any form submission. This is true for any plain old HTML form, which is (once your view is generated) really what you're dealing with.
If you're coming from a WebForms background, there is no ViewState in any version of the MVC Framework (Full framework or .NET Core), so it's up to you as the developer to persist those values across requests.
I'm having an issue with one of my webpages in my ASP.NET MVC Application. I have the HTML in Webstorm, and when I open it from there, it looks as intended. When I then copy over to the View in Visual Studio all of the Form controls are a mess.
Even if I directly copy everything from Webstorm into the _layout.cshtml, leaving only the script and style links (and RenderBody();) it's still completely off.
The Form itself is just copied from getbootstrap.com so it should be just fine. I have no clue what the issue could be, I hope someone has an idea.
Link so you can see the issue: https://imgur.com/a/bxFrr3P
Markup from Webstorm:
<div id="wrapper" >
<div id="content-wrapper" class="d-flex flex-column ">
<!-- Main Content -->
<div id="content" style="width: 100%;">
<hr>
<div class="container-fluid">
<div class="d-sm-flex align-items-center justify-content-between mb-4">
<h1 class="h3 mb-0 text-gray-800">Page Title</h1>
</div>
<div class="col-xl col-md mb-4 " >
<div class="card shadow h-100 py-2 card-background" >
<div class="card-body" style="padding: 0px;">
<div class="box-part text-center mt-2 mr-2 mb-2 ml-2 m-3">
<form>
<div class="form-row">
<div class="form-group col-md-6">
<label for="inputEmail4">Email</label>
<input type="email" class="form-control" id="inputEmail4">
</div>
<div class="form-group col-md-6">
<label for="inputPassword4">Password</label>
<input type="password" class="form-control" id="inputPassword4">
</div>
</div>
<div class="form-group">
<label for="inputAddress">Address</label>
<input type="text" class="form-control" id="inputAddress" placeholder="1234 Main St">
</div>
<div class="form-group">
<label for="inputAddress2">Address 2</label>
<input type="text" class="form-control" id="inputAddress2" placeholder="Apartment, studio, or floor">
</div>
<div class="form-row">
<div class="form-group col-md-6">
<label for="inputCity">City</label>
<input type="text" class="form-control" id="inputCity">
</div>
<div class="form-group col-md-4">
<label for="inputState">State</label>
<select id="inputState" class="form-control">
<option selected>Choose...</option>
<option>...</option>
</select>
</div>
<div class="form-group col-md-2">
<label for="inputZip">Zip</label>
<input type="text" class="form-control" id="inputZip">
</div>
</div>
<div class="form-group">
<div class="form-check">
<input class="form-check-input" type="checkbox" id="gridCheck">
<label class="form-check-label" for="gridCheck">
Check me out
</label>
</div>
</div>
<button type="submit" class="btn btn-primary">Sign in</button>
</form>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</body>
Sounds like bootstrap isn't loading.
I would reinstall bootstrap and/or check your package references.
I am working with ASP.NET in a web application What I want to do is that when you enter the system, depending on the user, some input text is enabled. For example, if the user is an administrator, all the input texts are enabled but if they are a normal user, all are disabled.
It is necessary to keep in mind that you used session variables depending on the type of user:
Session["typeUser"] (String)
user
admin
technical
helpdesk
I was consulted and can be done with this function
#HttpContext.Current.Session["typeUser"].ToString();
This is the code cshtml of the form where the fields that I want are not editable. Within this form I do not want the first three fields to be editable: Enrollment, Full Name and Email
<form id="InformationUser" class="contact-form">
<div class="box-body">
<div class="form-group">
<label for="Enrollment">Enrollment</label>
<input type="text" name="Enrollment" class="form-control" />
</div>
<div class="form-group">
<label for="Full name">Full name:</label>
<input type="text" name="Full name" class="form-control" />
</div>
<div class="form-group">
<label for="Email">Email:</label>
<input type="text" name="email" class="form-control" />
</div>
<div class="form-group">
<label for="Extension">Extension:</label>
<input type="text" name="extension" class="form-control">
</div>
<div class="form-group">
<label for="Area">Area:</label>
<select name="area" class="form-control select2 select2-hidden-accessible" style="width: 100%;" tabindex="-1" aria-hidden="true"></select>
</div>
<div class="form-group">
<label for="Ubicacion">Ubicacion:</label>
<select name="ubicacion" class="form-control select2 select2-hidden-accessible" style="width: 100%;" tabindex="-1" aria-hidden="true"></select>
</div>
</div>
</form>
Add some javascript at the end to do the job for you. Assuming you have razor view engine, this should give you some idea of how to approach it:
<script type='text/javascript'>
var role = #HttpContext.Current.Session["typeUser"].ToString();
switch (role){
case "user" :
document.getElementByName("Enrollment").disabled=true; // or whatever
break;
}
</script>
is there any reason that my final step i call confirmation isn't showing in the formwizard?
<form id="wizardForm" action="" method="post">
<div id="fieldWrapper">
<div class="step" id="first">
<span class="font_normal_07em_black step_title">Site Information</span><br />
<label for="Title">Title</label>
<input id="Title" class="input_field_12em required" type="text" />
<label for="Description">Description</label>
<input id="Description" class="input_field_12em required" type="text" />
<label for="UrlName">Url Name</label>
</div>
<div class="step" id="ownerInfo">
<span class="font_normal_07em_black step_title">Site Owner</span>
<label for="PrimaryOwner">Primary Owner</label>
<input id="PrimaryOwner" class="input_field_12em required" type="text" />
<label for="SecondaryOwner">Secondary Owner (nt id)</label>
<input id="SecondaryOwner" class="input_field_12em required" type="text" />
</div>
<div class="step" id="siteAccess">
<span class="font_normal_07em_black step_title">Site Access</span>
<label for="I">Public or private info <br />
Will private information be stored in this space?</label>
<input id="iYes" name="I" type="radio" value="Yes" />Yes<br />
<input id="iNo" name="I" type="radio" value="No" />No
<hr />
<label for="T">Will T Information be stored on this space?</label>
<input id="TYes" name="T" type="radio" value="Yes" onclick="ToggleT()" />Yes<br />
<input id="TNo" name="T" type="radio" value="No" onclick="ToggleT()" />No
<div id="tAcknowledgeContainer" class="hidden_contain">
<input type="checkbox" id="tCheckbox" /><span class="checkbox_label">I acknowledge </span>
</div>
<hr />
<label for="C">Will space need to Control content?</label>
<input id="cYes" name="C" type="radio" value="Yes" onclick="ToggleC()" />Yes<br />
<input id="cNo" name="C" type="radio" value="No" onclick="ToggleC()" />No
<div id="cAcknowledgeContainer" class="hidden_contain">
<input type="checkbox" id="cCheckbox" />
<span class="checkbox_label">I agree </span>
</div>
<hr />
<label for="F">Is Other User Access Required?</label>
<input id="FYes" name="F" type="radio" value="Yes" onclick="ToggleF()" />Yes<br />
<input id="FNo" name="F" type="radio" value="No" onclick="ToggleF()" />No
<div id="fPleaseNoteContainer" class="hidden_contain">
<span class="please_note"><strong>Please Note</strong><br />
</span>
</div>
<hr />
<label for="N">Non Employee(s)?</label>
<input id="NYes" name="N" type="radio" value="Yes" onclick="ToggleN()" />Yes<br />
<input id="NNo" name="N" type="radio" value="No" onclick="ToggleN()" />No
<div id="nAcknowledgeContainer" class="hidden_contain">
<input type="checkbox" id="nCheckbox" />
<span class="checkbox_label">
I agree
</span>
</div>
</div>
<div class="step" id="siteSharing">
<span class="font_normal_07em_black step_title">Site Sharing</span>
<div class="side_by_side_container">
<div class="left_container">
<input id="SharingRestrictionN2S" name="SharingRestriction" type="radio" value="N2S" />
<span class="generic_label">Public</span><br />
</div>
<div class="right_container">
<input id="SharingRestrictionN2K" name="SharingRestriction" type="radio" value="N2K" />
<span class="generic_label">Private</span><br />
</div>
</div>
</div>
<div class="step" id="agreement">
<span class="font_normal_07em_black step_title">Agreements</span>
<div>
<br />
<div>Business Agreement</div>
<iframe id="bFrame" class="generic_iframe" src="<%= ConfigurationManager.AppSettings["businessUrl"] %>"></iframe>
<br /><br />
<hr />
<br />
<div>Service Agreement</div>
<iframe id="sFrame" class="generic_iframe" src="<%= ConfigurationManager.AppSettings["sericeUrl"] %>"></iframe>
<br /><br />
<hr />
<br />
I agree
</div>
<br />
<input id="sbAggrement" class="required" type="checkbox" />
<span class="checkbox_label">
i agree
</span>
</div>
<div id="final" class="step submit_step">
<span class="font_normal_07em_black step_title">Confirmation</span>
<input type="text" name="temp1" />
</div>
</div>
<br />
<hr class="form_divider" />
<div id="wizardNavigation">
<input class="navigation_button" value="Back" type="reset" />
<input class="navigation_button" value="Next" type="submit" />
</div>
</form>
seems like it submits on the prior step and doesn't even hit this step. i thought you had to include the class step and submit_step because when i remove "step" it doesn't add this as another wizard step. if displays it on the bottom of every step.
also on the final submit, has anyone done anything where they call ajax to perform the submit so that if an error occurs the user doesn't leave the page and still has all their data to attempt again?
i am using c#, mvc2 and testing with Firefox browser
add onsubmit="return false;" to the form to make it so u can manipulate the post data
and in the jquery:
$("form").submit(function(){
$.post('postFile....',$(this).serialize(),function(data){
console.log(data);
//do something with data
})
})
When the Wizard button caption is next it will fire the
$("#form1").bind("step_shown", function (event, data) {
if (data.currentStep == "Div0") {
//Code that needs to be implemented in the step 0
}
if (data.currentStep == "Div1") {
//Code that needs to be implemented in the step 1
}
});
But when the Wizard button caption is Submit the final step in Wizard will be fired in the method mentioned bellow
$("#form1").formwizard({
formPluginEnabled: true,
validationEnabled: true,
focusFirstInput: true,
formOptions: {
success: function (data) {
//Last step completed message
},
beforeSubmit: function (data) {
//Code that need to be implemented for the submit method
},
dataType: 'json',
resetForm: true
}});
Please let me know has this resolved your issue.
:) Coding :)
i found an issue. it seems that the required class on the checkbox before the final confirmation step was throwing a javascript error.
<input id="sbAggrement" class="required" type="checkbox" />
i removed the required class and the final step is displayed when the next button is clicked. Now onto the next problem, why is the required class on the checkbox throwing a javascript error.......
instead of having the required class on the input, I added the checkbox to the validationOptions and it works perfectly now