Viewing 6 posts - 1 through 6 (of 6 total)
  • Author
    Posts
  • #4667

    When adding a new entry I’ve been unable to get custom UI elements to submit their value. I added a dropdown (Select) box and also radio buttons, but the values are not being submitted. I’ve tested this elsewhere and the values work, but somehow they are not being submitted with Avia. The $_POST value is null.

    You can see an example of the fields I’d like to submit here: http://marklenser.com/test.php

    Any suggestions?

    #47135

    Hey,

    did you add the class “avia_send_by_js” to your form elements? Following code in aviafeedback js file indicates that the class is required to get the values for the ajax function.

    var button = $(this),
    parent = button.parents('.avia_feedback_inner_form'),
    commentParent = button.parents('.avia_feedback_entry_content'),
    commentCounter = $('.avia_feedback_comment span', commentParent),
    elements = $('input[type=text]:visible, textarea',parent),
    id = $('.avia_send_by_js',parent).val(),
    datacheck = container.methods.checkData(elements),
    datastring = "ajax=true&action="+event.data.context+"&id="+id;

    #47136

    I should also note that if I make it a text input it works flawlessly.

    The avia_send_by_js class is in a hidden field in the form as by default:

    $feedbackHTML .= ” <input type=’hidden’ value=’”.$post_id.”‘ name=’avia_”.$context.”_post_id’ class=’avia_send_by_js’ />”;

    I copied the code from the other fields, they do not have this class

    $feedbackHTML .= ” <p>”;

    $feedbackHTML .= ” <label for=’avia_”.$context.”_name’>Your Name</label>”;

    $feedbackHTML .= ” <input type=’text’ value=” class=’avia_text_input’ name=’avia_”.$context.”_name’ id=’avia_”.$context.”_name’ />”;

    $feedbackHTML .= ” </p>”;

    $feedbackHTML .= ” <p>”;

    $feedbackHTML .= ” <label for=’avia_”.$context.”_mail’>Your E-Mail (won’t be displayed)</label>”;

    $feedbackHTML .= ” <input type=’text’ value=” class=’avia_text_input’ name=’avia_”.$context.”_mail’ id=’avia_”.$context.”_mail’ />”;

    $feedbackHTML .= ” </p>”;

    $feedbackHTML .= ” <p>”;

    $feedbackHTML .= ” <label for=’avia_”.$context.”_titel’>Subject</label>”;

    $feedbackHTML .= ” <input type=’text’ value=” class=’avia_text_input’ name=’avia_”.$context.”_titel’ id=’avia_”.$context.”_titel’ />”;

    $feedbackHTML .= ” </p>”;

    #47137

    With that post you might have given me the answer though. Here is feedbackbox.js:

    parent = button.parents(‘.avia_feedback_inner_form’),

    commentParent = button.parents(‘.avia_feedback_entry_content’),

    commentCounter = $(‘.avia_feedback_comment span’, commentParent),

    elements = $(‘input[type=text]:visible, textarea’,parent),

    id = $(‘.avia_send_by_js’,parent).val(),

    datacheck = container.methods.checkData(elements),

    datastring = “ajax=true&action=”+event.data.context+”&id=”+id;

    look at the 4th line.

    #47138

    Solution: In feedbackbox.js search for “input[type=text]:visible, textarea” and replace it with “input[type=text]:visible, textarea, select, input[type=radio]“

    This allows submitting select drop downs and radio buttons

    My code looks as follows for each 3 lines:

    elements = $(‘input[type=text]:visible, textarea, select, input[type=radio]‘,parent),

    newFeedbackForm.find(‘input[type=text]:visible, textarea, select, input[type=radio]‘).val(”);

    commentParent.find(‘input[type=text]:visible, textarea, select, input[type=radio]‘).val(”);

    #47139

    Glad that you found a solution. I’ll report it to Kriesi – everyone can profit from it :)

Viewing 6 posts - 1 through 6 (of 6 total)

The topic ‘Avia Feedback Box unable to POST anything but a text field.’ is closed to new replies.