[JavaScript] [PHP] Problem

  • Hallo Community,
    ich habe ein kleines Problem und komme nicht weiter..


    Ich habe einen JavaScript (contactform.js) und dort sind halt die funktioniert.
    Jedoch funktioniert dort etwas nicht und ich weiß nicht woran es liegt.
    Es sollte wenn man auf "Senden (auf add.php)" klickt einen Link in eine Liste einfügen jedoch steht dort nur "Validation in arbeit ..." und es passiert nichts.


    Hier das gesamte contactform.js & add.php:
    Vielleicht kann mir einer da weiterhelfen :x


    contactform.js


    Code
    $(function(){$('.submit').click(function(){$('.errormessage').hide().empty();$('#validation').show();var submit_id = $(this).prop('id');$('#'+submit_id).hide();var requiredelement_ids = Array();var email_ids = Array();var form_value_array = Array();var radio_value = Array();var checkbox_value = Array();$('.af-formvalue').each(function(){var label = $(this).closest('.element').find('.labelelementvalue').html();// catch input text valuesif($(this).hasClass('af-inputtext')){var key = $(this).prop('id');var value = $('#'+$(this).prop('id')).val();form_value_array.push({'elementid': key, 'elementvalue': value, 'label':label});}// catch textarea valuesif($(this).hasClass('af-textarea')){var key = $(this).prop('id');var value = $('#'+$(this).prop('id')).val();form_value_array.push({'elementid': key, 'elementvalue': value, 'label':label});}// catch radiobutton valuesif($(this).is(':radio')){var key = $(this).prop('name');var value = $(this).val();var check_index_radio_form_value = form_value_array.length+1;if($(this).is(':checked')){form_value_array.push({'elementid': key, 'elementvalue': value, 'label':label});radio_value[key] = value;}if( $(this).is( $(this).closest('.element').find('input[name='+key+']:last')) ){if(!radio_value[key]){form_value_array.push({'elementid': key, 'elementvalue': '', 'label':label});}}}// catch checkbox valuesif($(this).is(':checkbox')){var key = $(this).prop('name');var value = $(this).val();if($(this).is(':checked')){form_value_array.push({'elementid': key, 'elementvalue': value, 'label':label});checkbox_value[key] = value;}if( $(this).is( $(this).closest('.element').find('input[name='+key+']:last')) ){if(!checkbox_value[key]){form_value_array.push({'elementid': key, 'elementvalue': '', 'label':label});}}}// catch select valuesif($(this).hasClass('af-select')){var key = $(this).prop('id');var value = $(this).val();form_value_array.push({'elementid': key, 'elementvalue': value, 'label':label});}// catch time valuesif($(this).hasClass('af-time')){var key = 'element-'+$(this).closest('.element').prop('id');var ampm = $(this).closest('.element').find('.time-ampm').val();if(ampm == undefined) ampm = ''; // no quote on undefinedvar value = $(this).closest('.element').find('.time-hour').val()+':'+$(this).closest('.element').find('.time-minute').val()+' '+ampm;form_value_array.push({'elementid': key, 'elementvalue': value, 'label':label});}});/*var i;var debug_form_values = '';for (i = 0; i < form_value_array.length; ++i){debug_form_values += form_value_array[i]['elementid']+ ' | '+form_value_array[i]['label']+ ' => '+form_value_array[i]['elementvalue']+"\n";}alert(debug_form_values);*/// catch required elements ids for non empty validation$('input[type=checkbox][name="requiredelement[]"]').each(function(){requiredelement_ids.push('element-'+$(this).val());}); // catch required email elements ids for email validation$('input[type=checkbox][name="emailrequiredelement[]"]').each(function(){email_ids.push('element-'+$(this).val());}); var captcha_img;var captcha_input;if($('.captcha_img').length){captcha_img = 1;captcha_input = $('#captcha_input').val();} $.post('../inc/form-validation.php.htm',{ 'requiredelement' : requiredelement_ids, 'emailrequiredelement':email_ids, 'captcha_img':captcha_img, 'captcha_input':captcha_input, 'form_value_array':form_value_array},function(data){//$('#validation').hide();// alert('DATA :'+data);response = jQuery.parseJSON(data);if(response['status'] == 'ok'){validation_message = '<div class="validationmessage">'+response['message']+'</div>';$('.element').each(function(){if(!$(this).find('.title').html()){$(this).slideUp('fast');}});$('#contactform-content').append(validation_message);} else{ $('#'+submit_id).show();for(var i=0; i<response['message'].length; i++){$('#errormessage-'+response['message'][i]['elementid']).append(response['message'][i]['errormessage']);$('#errormessage-'+response['message'][i]['elementid']).fadeIn();}}} /* end function data */); /* end $.post */}); /* end click submit */});


    add.php


    HTML
    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"><html xmlns="http://www.w3.org/1999/xhtml"><head><meta http-equiv="Content-Type" content="text/html; charset=utf-8" /><title>Link einsenden</title><link rel="stylesheet" type="text/css" href="contactform/css/contactform.css"/><script src="http://ajax.googleapis.com/ajax/libs/jquery/1.7.1/jquery.min.js"></script><script src="contactform/js/contactform.js"></script></head><body><div id="contactform"><div id="contactform-content"><div class="element"><div class="option-container"><span class="title " style="color:#26ADE4;font-family:Arial;font-size:2.2em;font-weight:bold;">Link einsenden</span></div></div><div class="element"><label id="label-element-7" class="label" style="color:#4DBCE9;font-family:Trebuchet MS;font-size:1.2em;font-weight:normal;"><span class="labelelementvalue">Link</span><span class="required">*</span></label><div class="errormessage" id="errormessage-element-7"></div><div class="option-container"><input class="af-inputtext af-formvalue " type="text" name="element-7" id="element-7" value="" style="color: rgb(0, 0, 0); font-family: Verdana; font-size: 0.8em; font-weight: normal; width: 231px; border: 1px solid rgb(220, 220, 220); border-top-left-radius: 5px; border-top-right-radius: 5px; border-bottom-right-radius: 5px; border-bottom-left-radius: 5px; padding: 5px; "></div><input type="checkbox" style="display:none" value="7" checked="" name="requiredelement[]" id="requiredelement-7"></div><div class="element"><label id="label-element-9" class="label" style="color:#4DBCE9;font-family:Trebuchet MS;font-size:1.2em;font-weight:normal;"><span class="labelelementvalue">Kategorie</span><span class="required">*</span></label><div class="errormessage" id="errormessage-element-9"></div><div class="option-container"><select class="af-select af-formvalue " name="element-9" id="element-9" style="color:#000000;font-family:Verdana;font-size:0.8em;font-weight:normal;; "><option value="Shops" selected="selected">Shops</option><option value="Blogs">Blogs</option><option value="Scene Boards (DE)">Scene Boards (DE)</option><option value="Scene Boards (RU)">Scene Boards (RU)</option><option value="Scene Boards (TR)">Scene Boards (TR)</option><option value="Scene Boards (US)">Scene Boards (US)</option><option value="Filme und Serien">Filme und Serien</option><option value="Games">Games</option><option value="Musik">Musik</option><option value="Offshore Hoster">Offshore Hoster</option><option value="Online TV">Online TV</option><option value="Sport Streaming">Sport Streaming</option><option value="VPN">VPN</option><option value="Warez">Warez</option></select></div><input type="checkbox" style="display:none" value="9" checked="" name="requiredelement[]" id="requiredelement-9"></div><div class="element"><div class="option-container"><input type="submit" name="element-5" id="element-5" value="senden" class="submit " style="color:#555555;font-family:Arial;font-size:1.3em;font-weight:bold;background-color:#f1f1f1;border:1px solid #cccccc;width:140px;; "></div></div><div id="validation">Validation in arbeit ...</div></div><!--contactform-content--></div><!--contactform--></body></html>


    Danke im voraus falls jemand damit klar kommt & mir weiterhilft :x


    Viele Grüße,
    Cripain