开发者

Checkbox or button inside of a form to run a task without submit?

I have a real problem, I can't get sorted out?

I have a form to look up Users and it brings back the user by id of course. Then you can look at their profile and see their email, comments and whatever. You can make little changes and click the save button and it UPDATES the record.

I have another php script that needs the $email variable from that exact user to process another script to "suspend" their billing payment? (since they are only lined by email)

I was thinking of having either a button or checkbox that basically states, Check or Press to Suspend this user (without clicking the Save on the main form) so it works independently, but still needs to grab the $email via POST or GET or $email = (isset($_POST['email']) ? $_POST['email'] : "");

Maybe an Ajax or Jquery script... Or can I do this with PHP?

I don't even know if it is doable开发者_开发问答. If I run the script on it's own, via GET, it works perfect with the errors and echo statements, but I think there is a better work around. It would be nice to just click a button or check to run a process and get a returned echo!

If button is clicked or checkbox is checked run this script and pass it a variable sort of thing??

Thanks in advance, I'm not sure where to start??


Yes use AJAX in jQUERY

$('#radio_button_id').click(function(){

$.ajax({
type: "POST",
url: "file.php",
data : "?id=id",
cache : false,
success: function(html) { $('#div_id').html(html); }
});

});
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜