i want to write a plugin which will pass a variable stored as input(which is an image) id to the form on clicking the input image or by any other method
=========================================================================================
<?php
echo $_POST['id'];
?>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Kunfu Panda</title>
<link href="css/main.css" rel="stylesheet" type="text/css" media="projection,screen" />
</head>
<body>
<div class="wrapper" >
<form action="panda.php" method="post" class="openid_provider" />
<input type="image" src="images/google_button.png" id="google" />
</form>
</div>
<script type="text/javascript" src="js/test.js"></script>
<script type="text/javascript" src="js/jquery-ui-1.8.19.custom.min.js"></script>
<script type="text/javascript">
$(document).ready(function(){
$('form').openid();
})
</script>
</body>
</html>
===============================================================================
my plugin is openid (test,js)
(function($){
$.fn.openid = function() {
$('input').click(function(){
var provider = $(this).attr('name');
$(this).submit(provider);
})
}
})(jQuery);
now the form is getting submitted on click on google image which is an input with id “google” but the form action which is the same page is not able to recognise the $_POST[‘provider’] variable
please help me out.
Try this:
js: