I want to automate a click function with the following piece of code so that the form votes are directly submitted. Is there any way to create a standalone script that submits the votes without having to refresh the webpage:
<input type="submit" id="edit-vote" name="op" value="Vote" class="form-submit" /> </div>
<input type="hidden" name="form_build_id" value="form-_uSQFCS2yhwHuEB3IMSjehiyfoonqUt9ExArzLqWrqo" />`</div>
This is the radio button I want to click:<div class="form-item form-type-radio form-item-choice">
<input type="radio" id="edit-choice-39328" name="choice" value="39328" class="form-radio" /> <label class="option" for="edit-choice-39328"> OPTION </label>
Please suggest if more information is needed
Add a class to your radio input then
$("input.your_class").change(function() {
if ($(this).prop("checked")) {
$("#your_form_element_id').submit();
}
});
I assume you have a form element (wrapping your input[type=submit] and your input[type=hidden]) with the id 'your_form_element'.
Good luck