[jQuery] Re: very simple jQuery not working
I was looking for .keyup() not .change(), sorry. Please ignore. On Dec 16, 3:37 pm, Brett Alton brett.jr.al...@gmail.com wrote: html head script type=text/javascript src=http://ajax.googleapis.com/ajax/ libs/jquery/1.3.2/jquery.min.js charset=utf-8/script /head body script type=text/javascript alert('outside'); $('input').change(function() { alert('inside'); }); /script pinput type=text id=dig //p /body /html Why does the alert with 'inside' never appear? I tried wrapping it in $(document).ready(function(){ and it made no difference. No errors in Firefox or Chromium too.
[jQuery] jQuery, $.ajax and reCAPTCHA
I'm trying to get jQuery to asynchronously load my recaptcha module, but it doesn't seem to like the fact that echo recaptcha_get_html ($publickey); spits out a mixture of HMTL and Javascript. Here's the code I am trying: script $.ajax({ url: inc/captcha.php, cache: false, success: function(html){ //$(#results).append(alert(html); $(#results).append(html); } }); // This does the same thing /*$.post(inc/test.php,function(returned_data){ $(#results).append(returned_data); });*/ /script div id=results/div It spits me out to a page with _just_ the recaptcha widget. I tested to see if it was my ajax call by making 'inc/captcha.php' merely say Hello! but it works. The offending reCAPTCHA code is possibly: script type=text/javascript src=http://api.recaptcha.net/challenge? k=6Lfz5AkAAKMcQLT5Q8_PrBHNZx4B8v34ABCC/script noscript iframe src=http://api.recaptcha.net/noscript? k=6Lfz5AkAAKMcQLT5Q8_PrBHNZx4B8v34ABCC height=300 width=500 frameborder=0/iframebr/ textarea name=recaptcha_challenge_field rows=3 cols=40/ textarea input type=hidden name=recaptcha_response_field value=manual_challenge/ /noscript
[jQuery] jQuery and $.post with PHP and $_POST
How do I get PHP to print JavaScript variables via $_POST? jQuery's $.post doesn't seem to be submitting any data. This is a sample of what I have... test.php: -- ?php echo 'pre'; print_r($_POST); echo '/pre'; ? form method=post action=test.php id=test input id=submit name=submit type=submit value=Submit /form -- jquery.js: -- $(document).ready(function() { $(form#test).bind('submit',(function(){ $.post(test.php,{ // no matter what I put in here, nothing shows up in test.php }); }); }); -- I've also tried: $(form#test).submit(function(){ instead of bind...
[jQuery] Re: jQuery and $.post with PHP and $_POST
Isn't that what $.post is for though? $(form#test).bind('submit',(function(){ $.post(editcustommenu-new.php,{ menu_bg_colour_selector: $('#menu_bg_colour_selector').val() });*/ alert('form submitted'); }); Isn't that supposed to pass 'menu_bg_colour_selector' to $_POST? Or am I mixing something up... My alert seems to work, but the $.post function doesn't seem to pass anything to my PHP code. On Dec 24, 7:40 am, Karl Rudd karl.r...@gmail.com wrote: Unless a submit button is explicitly pressed it's value won't be sent. So in the case given, since there are no other form elements, nothing with be posted to the server. Karl Rudd On Wed, Dec 24, 2008 at 11:36 PM, Brett Alton brett.jr.al...@gmail.com wrote: How do I get PHP to print JavaScript variables via $_POST? jQuery's $.post doesn't seem to be submitting any data. This is a sample of what I have... test.php: -- ?php echo 'pre'; print_r($_POST); echo '/pre'; ? form method=post action=test.php id=test input id=submit name=submit type=submit value=Submit /form -- jquery.js: -- $(document).ready(function() { $(form#test).bind('submit',(function(){ $.post(test.php,{ // no matter what I put in here, nothing shows up in test.php }); }); }); -- I've also tried: $(form#test).submit(function(){ instead of bind...
[jQuery] Add click() event to each() loop constructor
Sorry, I'm new to Google Groups and was trying to reply to a post but couldn't figure out how without e-mailing the author directly[1]. I'm trying to add the click() event to the each() loop constructor. e.g. $(document).ready(function() { $(a[id*='activate-']).each(function(i){ $('#toggle1-'+i).slideToggle('slow'); $('#toggle2-'+i).slideToggle('slow'); }); }); This works, and toggles all corresponding ids called '#toggle1-'+i and #toggle2-'+i, but I only want it to activate when the anchor is clicked. Is this possible? [1] http://groups.google.com/group/jquery-en/browse_thread/thread/b6d1dea588cab69d/6b7427b0dd9281d7
[jQuery] Re: Add click() event to each() loop constructor
That was too easy. Thank you for the quick response! $(document).ready(function() { $(a[id*='activate-']).each(function(i){ $(this).click(function(){ $('#toggle1-'+i).slideToggle('slow'); $('#toggle2-'+i).slideToggle('slow'); }); }); }); On Dec 10, 1:59 pm, Brian Cherne [EMAIL PROTECTED] wrote: If I understand your question properly, it is possible. Try something like this: $(document).ready(function() { $(a).each(function(i){ $(this).click(function(){ alert(i); }); }); }); Brian. On Wed, Dec 10, 2008 at 10:29 AM, Brett Alton [EMAIL PROTECTED]wrote: Sorry, I'm new to Google Groups and was trying to reply to a post but couldn't figure out how without e-mailing the author directly[1]. I'm trying to add the click() event to the each() loop constructor. e.g. $(document).ready(function() { $(a[id*='activate-']).each(function(i){ $('#toggle1-'+i).slideToggle('slow'); $('#toggle2-'+i).slideToggle('slow'); }); }); This works, and toggles all corresponding ids called '#toggle1-'+i and #toggle2-'+i, but I only want it to activate when the anchor is clicked. Is this possible? [1] http://groups.google.com/group/jquery-en/browse_thread/thread/b6d1dea...
[jQuery] Manipulating input fields
I'm trying to take the input from one text input field to the next and I'm not sure how to do it through jQuery. Can someone please send me a tutorial or example of how to do so? Right now I have: $(document).ready(function() { $(#agentfirstname).change(function() { // take the content from #agentfirstname, set it to lowercase and place it in // the text field #agentusername $(#agentusername).val($(#agentfirstname).text().toLowerCase()); alert('Here'); }); }); Where I am trying to take the input from #agentfirstname and put it in #agentusername. What functions am I to use in jQuery? Should I be using toLowerCase()? The alert appears to work, so I know jQuery is capturing the .change, I just need to know how to manipulate input fields. The HTML looks like so: input type=text name=agentfirstname id=agentfirstname class=textfield tabindex=2 / input type=text name=agentusername id=agentusername class=textfield tabindex=5 / Thanks for all your help!