How do I save a front-end form as a specific Entry Type? I have a few different forms on my site for different kinds of enquiries, each represented by an Entry Type with different fields in a single Enquiries channel. How can I get the entries/saveEntry form to save as a specific entry type?

My existing form:

&lt;input type="hidden" name="action" value="guestEntries/saveEntry"&gt;
&lt;input type="hidden" name="redirect" value="/hire-us/get-a-quote/success"&gt;
&lt;input type="hidden" name="sectionId" value="61"&gt;


I have two entry types in that channel, ID 111 and 112. When I add the line:

&lt;input type="hidden" name="typeId" value="111"&gt;


then submit the form, I get an error message saying "Unable to find the template 'hire-us/enquiryPlanningEvent'". It appears that Craft is looking for a template named after the entry type I'm trying to save, but obviously there isn't one.
What's the solution to this?
This has been solved via a support ticket, which I'm posting here for others etc.


  The first time you load the template, the URI is mapping to your "Get
  A Quote" entry, which gets assigned to the entry variable when your
  template is loaded.
  
  When you submit the form, the same URL is requested again, once again
  matching your "Get A Quote" entry, but this time the
  guestEntries/saveEntry controller action is summoned. When there's a
  validation error, Guest Entries will pass the new entry back to the
  template as an entry variable, overriding the "Get A Quote" entry that
  the URL matched. So, then the template gets routed to
  hire-us/index.html like it normally did, but this time entry.type is
  enquiryWeddingDance instead of getAQuote, since it's a different entry
  altogether. The template tries to include
  hire-us/enquiryWeddingDance.html, but that doesn't exist, so you get
  the error.
  
  To fix this, I've just released an update to the Guest Entries plugin,
  which adds a new entryVariable config setting. You can use that to
  customize the variable name that Guest Entries will set the invalid
  entry to (i.e. 'guestEntry' or 'invalidEntry'), so it doesn't conflict
  with the entry variable that the request is getting routed to.


After setting the Guest Entries variable as suggested in the documentation, it's now working as expected without conflicts. Thanks Brandon!

Usage:

{% if guestEntry is defined %}{{ errorList(guestEntry.getErrors('variableName')) }}{% endif %}