CodingForums.com

CodingForums.com (http://www.codingforums.com/index.php)
-   Ajax and Design (http://www.codingforums.com/forumdisplay.php?f=55)
-   -   Resolved Using a PHP Constant in AJAX html (http://www.codingforums.com/showthread.php?t=273725)

dstu 09-21-2012 06:40 AM

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.

dstu 09-21-2012 07:21 AM

Quote:

Originally Posted by dstu (Post 1271978)
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);?>');



All times are GMT +1. The time now is 08:43 PM.

Powered by vBulletin®
Copyright ©2000 - 2013, Jelsoft Enterprises Ltd.