I'm just trying to create a simple form to save an Opportunity. For some reason, the page isn't saving and not giving me any console errors. Here is the code:
<apex:page showHeader="false" controller="NewWeb2Opportunity">
<script src="//ajax.googleapis.com/ajax/libs/jquery/1.11.0/jquery.min.js"></script>
<link rel="stylesheet" href="//netdna.bootstrapcdn.com/bootstrap/3.1.1/css/bootstrap.min.css"/>
<link rel="stylesheet" href="//netdna.bootstrapcdn.com/bootstrap/3.1.1/css/bootstrap-theme.min.css"/>
<script src="//netdna.bootstrapcdn.com/bootstrap/3.1.1/js/bootstrap.min.js"></script>
<div id="Wrapper">
<div id="Header"/>
<div id="theBody">
<div id="CaseForm">
<form>
<apex:form >
<table cellpadding="10" class="form-group">
<tr>
<h1>Contact Us</h1>
<p>Please enter your information below and we will follow up with you as soon as we can.</p>
</tr>
<tr id="theaccount">
<td><label class="col-lg-12 control-label" for="">Contact Name</label></td>
<td><apex:inputField styleClass="form-control" id="account" value="{!opp.AccountId}"/></td>
</tr>
<tr>
<td><label class="col-lg-12 control-label" for="">Stage</label></td>
<td><apex:inputField styleClass="form-control" id="stage" value="{!opp.StageName}"/></td>
</tr>
<tr>
<td><label class="col-lg-12 control-label" for="">Amount</label></td>
<td><apex:inputField styleClass="form-control" id="amount" value="{!opp.Amount}"/></td>
</tr>
<tr>
<td><label class="col-lg-12 control-label" for="">Probability</label></td>
<td><apex:inputField styleClass="form-control" id="prob" value="{!opp.Probability}"/></td>
</tr>
<tr>
<td><label class="col-lg-12 control-label" for="">Close Date</label></td>
<td><apex:inputField styleClass="form-control" id="date" value="{!opp.CloseDate}"/></td>
</tr>
<tr>
<td><label class="col-lg-12 control-label" for="subject">Subject</label></td>
<td><apex:inputField styleClass="form-control" id="name" value="{!opp.Name}" /></td>
</tr>
<tr>
<td><label class="col-lg-12 control-label" for="description">Description</label></td>
<td><apex:inputTextarea styleClass="form-control" id="newDesc" value="{!opp.description}"/></td>
</tr>
<tr>
<div id="button">
<apex:commandButton styleclass="btn btn-default" id="next" action="{!saveOpp}" value="Submit"/>
</div>
</tr>
</table>
</apex:form>
</form>
</div>
And the controller:
public class NewWeb2Opportunity{
public Opportunity opp {get;set;}
public NewWeb2Opportunity(){
opp = new Opportunity();
opp.AccountId = '001o0000005uBxaAAE';
opp.StageName = 'Prospect';
opp.Amount = 100000;
opp.Probability = 50;
opp.Name = 'Home Mortgage';
opp.Description = 'Looking for a new Home Loan.';
opp.RecordTypeId = '012o0000000auAL';
}
public PageReference saveOpp() {
insert opp;
PageReference pageRef = new PageReference('/'+ opp.Id);
return pageRef;
}
}
</apex:page>