Create Method instant success message

Options

Guys,

I have created a form within Convio using the ConsAPI. I am using the create method. The problem is that I am stuck and need a little push in the right direction.

I would like to display a thank you message upon a sucessful submission. If an error occurs I would like to let them know where the error is.

Here is my form along with the jQuery mark up that I would like to display once the record is created:

<div id="form_holder">

<form method="post" action="https://secure2.convio.net/ifcj/site/CRConsAPI">

<table cellpadding="0" cellspacing="0" border="0">

<tr>

<td align="center"><img src="http://org/images/elements/rr/rr_signup_heading.jpg" border="0" /></td>

</tr>

<tr>

<td><input name="cons_first_name" type="text" size="30" maxlength="100" class="first_name"><br><label for="first_name">First Name</label></td>

</tr>

<tr>

<td><input name="email" type="text" size="30" maxlength="100" class="email_address"><br><label for="email_address">Email Address</label></td>

</tr>

<tr>

<td><input type="image" src="http://org/images/elements/rr/rr_subscribe_button.jpg" value="Submit" name="Submit" class="button"></td>

</tr>

</table>

<input type="hidden" name="api_key" id="org" value="org">

<input type="hidden" name="v" id="v" value="1.0">

<input type="hidden" name="method" id="method" value="create">

<input type="hidden" name="add_group_ids" value="12345">

</form>

</div>

<script type="text/javascript">

$(document).ready(function(){

$("div#form_holder .button").click(function(){

$('#form_holder').html("<div id='message'></div>");

$('#message').html("<h2>Thank You!</h2>")

.append("<p>We will be in touch soon.</p>")

.hide()

.fadeIn(1500, function() {

$('#message').append("<img id='checkmark' src='images/check.png' />");

});

});

});

</script>

I have seen examples for donation forms and would like to know if there are any for simple form submissions for emails for example.

Thanks in advance

Tagged:

Comments

  • Have you looked at the jQuery form plugin? I don't know of a Convio-specific example, but the jQuery example looks pretty straightforward. Convio API calls can return either XML or JSON response documents which are easily parsed and processed in JavaScript.

Categories