I've a problem on my website. I currently have an application form and submits the form, an email is sent. I wish I could create a csv file to sending the form. And secondly, to automatically populate my database access via this CSV file.
My ASP form:
<div class="submit">
<div class="left">
<div class="field"><input id="inputFirstname" type="text" value="First name *" class="watermark" name="firstname"/></div>
<div class="field"><input id="inputLastname" type="text" value="Last name *" class="watermark" name="lastname"/></div>
<div class="field"><input id="inputEmail" type="text" value="E-mail *" class="watermark" name="email"/></div>
<div class="fieldradio" style="margin-bottom:10px;">
<label class="watermark" style="display:inline">Gender *</label>
<input id="inputGenderM" class="watermark" style="display:inline;width: 10px" name="gender" type="radio" />
<label class="watermark" style="display:inline">M</label>
<input id="inputGenderF" class="watermark" style="display:inline;width: 10px" name="gender" type="radio" />
<label class="watermark" style="display:inline">F</label>
</div>
</div>
<div class="right">
<div class="textarea"><textarea id="inputMessage" name="message" class="watermark">Add your message here</textarea></div>
<div style="float:left;width:100%; margin-top:30px;">
<div id="captchadiv"><input id="captchaInput" type="text" value="Enter validation text *" name="captchaInput" class="watermark" style="margin-top:10px;"/></div>
</div>
<div class="clear"></div>
<div class="submit_container" id="submitArea">
<a onclick="javascript:submitCV();" class="btn orange height_19 submit"><span>
SEND FORM</span></a>
</div>
</div>
My function JS "submitCV()" :
$(document).ready(
function(){
$.getJSON('http://jsonip.appspot.com/?callback=?',
function(data){
clientIP = data.ip;
});
function submitCV() {
if( $("#inputFirstname").val() == false)
{
$('#inputFirstname').addClass('errorValidationSubmit');
alert('Please fill the FirstName field ');
return;
}
if($("#inputLastname").val() == false)
{
$('#inputLastname').addClass('errorValidationSubmit');
alert('Please fill the LastName field ');
return;
}
var genderId = $('input[name=gender]:checked').attr('id');
if(typeof genderId == 'undefined')
{
$('.fieldradio').addClass('errorValidationSubmit');
alert('Please choose a gender ');
return;
}
if( validateEmail($("#inputEmail").val()) == false)
{
$('#inputEmail').addClass('errorValidationSubmit');
alert('Invalid e-mail address.');
return;
}
if( $(".submit .dropdown dt a").attr('href') =="#"){
$('.submit .dropdown').addClass('errorValidationSubmit');
alert('Please select an open position');
return;
}
if($("#captchaInput").val() == false || $("#captchaInput").val().length != 5)
{
$('#captchaInput').addClass('errorValidationSubmit');
$('.realperson-text').addClass('errorValidationSubmit');
alert('Please fill the Validation Text Field with the Captcha (5 characters)');
return;
}
var path = $(location).attr('href');
var capchallenge = cleanJSONString($(".realperson-hash").val());
//Recaptcha.get_challenge();
var capresponse = cleanJSONString($("#captchaInput").val());
//Recaptcha.get_response();
try {
var parameters = '{ "url" : "' + escape(path) +
'", "clientip" : "' + clientIP +
'", "firstname" : "' + cleanJSONString($("#inputFirstname").val()) +
'", "lastname" : "' + cleanJSONString($("#inputLastname").val()) +
'", "gender" : "' + cleanJSONString(genderId) +
'", "email" : "' + cleanJSONString($("#inputEmail").val()) +
'", "message" : "' + cleanJSONString($("#inputMessage").val()) +
'", "position" : "' + cleanJSONString($(".submit_cv .dropdown dt a").attr('href')) +
'", "captchachallenge" : "' + capchallenge +
'", "captcharesponse" : "' + capresponse + '" }';
contentSubmit = $("#submitArea").html();
$("#submitArea").empty().html('<img src="/Style%20Library/ajax-loader.gif" />');
jQuery.ajax({
type: "POST",
url: '_vti_bin/json/monservice.svc/submit',
contentType: "application/json; charset=utf-8",
dataType: 'json',
data: parameters,
success: function (msg) {
submitSucceeded(msg);
$("#submitArea").empty().html(contentSubmit);
resetRealPersonCaptcha();
alert(parameters);
},
error: submitFailed
});
}
catch (e) {
alert('Error invoking service' + e);
clearUploadPart();
}
//Recaptcha.reload();
}
function submitSucceeded(result) {
alert(result.submitResult);
if (!result.submitResult.contains("The captcha verification didn't work. Please try again")) {
clearUploadPart();
}
}
function submitFailed(error) {
alert('An error occured.');
//clearUploadPart();
resetRealPersonCaptcha();
$("#submitArea").empty().html(contentSubmit);
}
Is there a relatively quick opportunity to put in place to create a CSV file to be stored in one place? What do you recommend?
On the other hand, I want that every new CSV file, I can populate an Access database. If my CSV files on a FTP folder, you it is the possibility of a Unix script or simply VB?