Run jQuery on signup.php template

Discussion in 'aMember Pro v.4' started by rendersnag, Dec 12, 2011.

  1. rendersnag

    rendersnag Member

    Joined:
    Jan 28, 2011
    Messages:
    35
    I am trying to run this bit of jquery in the signup template, but does not seem to work.

    HTML:
    <script type="text/javascript">
    jQuery(document).ready(function() {
        $('input#start_date-0').text('12/25/2011');
        $('input#end_date-0').text('12/26/2011');
        $('input#end_date-0').css("border","1px solid red");
        });
    </script>
    just trying to auto fill 2 form fields bases off of their IDs...

    Any idea why this does not work?
  2. graphixx

    graphixx Member

    Joined:
    Apr 19, 2008
    Messages:
    48
    HTML:
    <script type="text/javascript">
    jQuery.noConflict();
    jQuery(document).ready(function() {
        jQuery('input#start_date-0').text('12/25/2011');
        jQuery('input#end_date-0').text('12/26/2011');
        jQuery('input#end_date-0').css("border","1px solid red");
        });
    </script>
    What about if you try with the above?
  3. rendersnag

    rendersnag Member

    Joined:
    Jan 28, 2011
    Messages:
    35
    hey! that sorta worked! the css border applied to the id end_date-0, but the text was not applied to the same element.

    i did notice that i am getting an error:
    TypeError: 'undefined' is not a function (evaluating 'jQuery("a[rel^='prettyPhoto']").prettyPhoto()')

    this error is from a js file for the wordpress theme that i have installed. for my amember v4 pages, i am using the option to bring in my wordpress header and footer. if i applied the noConflict to the wordpress theme files, do you think that would help me?

    thanks a bunch!
  4. rendersnag

    rendersnag Member

    Joined:
    Jan 28, 2011
    Messages:
    35
    i just noticed that the js file that is generating the error IS running query in noConflict mode already...guess i'll keep diggin'!
  5. rendersnag

    rendersnag Member

    Joined:
    Jan 28, 2011
    Messages:
    35
    it looks like the dates ARE being applied to the input elements, but they do NOT display inside...see attached screen grab

    [​IMG]
  6. rendersnag

    rendersnag Member

    Joined:
    Jan 28, 2011
    Messages:
    35
    this worked!

    Code:
    jQuery('input#start_date-0').attr('value', '12/25/2011');
    jQuery('input#end_date-0').attr('value', '12/26/2011');
    thanks for your help graphixx!

Share This Page