Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 2 of 2
  1. #1
    New Coder
    Join Date
    Jul 2006
    Posts
    13
    Thanks
    2
    Thanked 0 Times in 0 Posts

    Question Using a PHP Constant in AJAX html

    Hello,

    I have a question regarding using a string that was preconfigured in a DEFINE function in AJAX.

    This is what I have (that I want to change):
    Code:
    $('#entry_error .ui-state-error-text').html('Please enter the required fields');
    If I try to do this, it doesn't work:
    Code:
    DEFINE('ENTER_FIELD','Please enter the required fields');
    
    ...
    
    $('#entry_error .ui-state-error-text').html(ENTER_FIELD);
    What's the proper way to use this constant in the AJAX command?

    Thanks.
    Last edited by dstu; 09-21-2012 at 08:23 AM. Reason: Resolved

  • #2
    New Coder
    Join Date
    Jul 2006
    Posts
    13
    Thanks
    2
    Thanked 0 Times in 0 Posts
    Quote Originally Posted by dstu View Post
    Hello,

    I have a question regarding using a string that was preconfigured in a DEFINE function in AJAX.

    This is what I have (that I want to change):
    Code:
    $('#entry_error .ui-state-error-text').html('Please enter the required fields');
    If I try to do this, it doesn't work:
    Code:
    DEFINE('ENTER_FIELD','Please enter the required fields');
    
    ...
    
    $('#entry_error .ui-state-error-text').html(ENTER_FIELD);
    What's the proper way to use this constant in the AJAX command?

    Thanks.
    I found the solution.

    I did this:

    Code:
    DEFINE('ENTER_FIELD','Please enter the required fields');
    
    ...
    
    $('#entry_error .ui-state-error-text').html('<? echo(ENTER_FIELD);?>');


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •