jQuery show submit button on input field click
- by Pjack
Hi,
I'm trying to have a comment input field that will show the submit button on a dynamically created form when you click on the input field.
Similar to how facebook comments work. When you click on the input field the submit button appears and when you click off it disappears.
All the comment input id's are comment_1 etc and the submit button id's are submit_1 etc.
I've tried this,
jQuery("#[id^='comment_']").live('click',function(event){
if(jQuery("#[id^='comment_']").val() == ""){
jQuery("#[id^='submit_']").hide();
}
else {
jQuery("#[id^='submit_']").show();
}
});
And that won't work for some reason. Any suggestion or how it can be accomplished would be great.