Checked input js going to page instead of loading page in div

<form method="post" action=""  onsubmit="ajax_follow_settings_update(); return false;">
<div style="float: left; width: 48px; border: 1px solid grey; text-align: center; margin: 0px 7px 3px 0px;">
  <a href="https://twitter.com/intent/user?user_id={{ user.id_str }}" target="_blank">
  <img src="{{ user.profile_image_url }}" width="48" height="48" title="Screen Name: {{ user.screen_name }} 
Full Name: {{ user.name }} 
Last Tweet: {{ user.status.text }} 
" />
  </a><br />
  <input type="checkbox" class="dcheck" name="follow_id[]" value="{{ user.id_str }}" />
 </div>
  <br>
  <input type="submit" value="Follow Selected Users" class="submit_button_style" onclick="ajax_follow_settings_update();" /></div>
  <br><br><br><div id="update_div"></div>

JS

function ajax_tweet_settings_update() {
 var form_data = $('input:checkbox:checked').serialize();
 $("#update_div").html(ajax_load).load('startfollow.php',form_data);
 
 
}

on submission it loads the startfollow page instead of updating the div.

any ideas?

Your code is a bit inconsistent.
Twice in the HTML you call “ajax_follow_settings_update()” but the JS you included is “ajax_tweet_settings_update()”

Is there a closing tag for the form that is simply not shown in this code?

thank you for spotting that must admit was a late one when writing this for me!

it’s all sorted now thank you for spotting that!!

can you see any reason it would pass a value of an array with the last value always being

[_] => 1436085878194 )

i can not see why it would do this.

This topic was automatically closed 91 days after the last reply. New replies are no longer allowed.