I have a form that I had hidden using jquery which on click is displayed.I want to post data using php but on clicking submit nothing happens.see code
if(isset($_POST['mailit'])) { echo"do something";}
$('.with-click-text').click(
function(e) {
$(this).css('overflow', 'visible');
$(this).find('.click-text')
.show()
.css('opacity', 0)
.delay(200)
.animate(
{
paddingTop: '25px',
opacity: 1
},
'fast',
'linear'
);
$("#submit").on("click",function(e){
$(this).submit();
});
});
Answer
You have no element with id submit
. Update your function;
....
$("input[type='submit']").on("click",function(){
event.preventDefault();
$(this).submit();
});
You can see demo here: Demo
No comments:
Post a Comment