<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.3.0/jquery.min.js"></script>
<script type="text/javascript">
$(function() {
$(".submit").click(function() {
var name = $("#created_by_name").val();
var email = $("#created_by_email").val();
var subject = $("#name").val();
var description = $("#body").val();
var submitted = $("#submitted").val();
var dataString = 'created_by_name='+ name + '&created_by_email=' + email + '&name=' + subject + '&body=' + description + '&submitted=' + submitted;
if(name=='' || email=='' || subject=='' || description=='' || submitted=='')
{
$('.success').fadeOut(200).hide();
$('.error').fadeOut(200).show();
}
else
{
$.ajax({
type: "POST",
url: "http://myactivecollabinstall.com/submit",
data: dataString,
success: function(){
$('.success').fadeIn(200).show();
$('.error').fadeOut(200).hide();
}
});
}
return false;
});
});
</script>
<form enctype="multipart/form-data" method="post" name="form">
<div class="info" style="padding-left:20px">
<h2>Submit to activecollab form</h2>
</div>
<ul>
<li id="foli1">
<label class="desc" for="created_by_name">Name</label>
<div>
<input id="created_by_name" name="ticket[created_by_name]" type="text" class="field text medium" value="" maxlength="255" tabindex="1" />
</div>
</li>
<li id="foli3">
<label class="desc" for="created_by_email">Email</label>
<div>
<input id="created_by_email" name="ticket[created_by_email]" type="text" class="field text medium" value="" maxlength="255" tabindex="3" />
</div>
</li>
<li id="foli4">
<label class="desc" for="name">Subject</label>
<div>
<input id="name" name="ticket[name]" type="text" class="field text medium" value="" maxlength="255" tabindex="4" />
</div>
</li>
<li id="foli6">
<label class="desc" for="body">Description</label>
<div>
<textarea id="body" name="ticket[body]" class="field text medium" tabindex="5"></textarea>
</div>
</li>
</ul>
<div class="buttons">
<input type="hidden" name="submitted" value="submitted" style="display: none" />
<button type="submit" accesskey="s" value="Submit" style="background:#0060a1; color:#FFFFFF; font-size:14px; border:1px solid #0060a1; margin-left:12px" class="submit"><span>Submit</span></button>
<span class="error" style="display:none"> Error</span>
<span class="success" style="display:none">Success! Ticket submitted.</span>
</div>
</form>
Instant access to activeCollab, no installation needed.
If you are already a user of activeCollab, you can log in here.
Is it possible to 'plug' aC's public submit form into a custom/static html file that would be on a different domain? Basically I want to make it easy for my client to send feedback on some work I'm doing, and would like to embed the form into the page I'm working on.
I was thinking of just pulling the code from the form (between <form> and </form>) but then realised the action="" attribute is blank...
Sooo.. Any tips on how to go about it?
Thanks, Leon.