Go Back   CodingForums.com > :: Client side development > JavaScript programming > Ajax and Design

Before you post, read our: Rules & Posting Guidelines

Reply
 
Thread Tools Rate Thread
Enjoy an ad free experience by logging in. Not a member yet? Register.
Old 09-21-2012, 06:40 AM   PM User | #1
dstu
New Coder

 
Join Date: Jul 2006
Posts: 13
Thanks: 2
Thanked 0 Times in 0 Posts
dstu is an unknown quantity at this point
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 07:23 AM.. Reason: Resolved
dstu is offline   Reply With Quote
Old 09-21-2012, 07:21 AM   PM User | #2
dstu
New Coder

 
Join Date: Jul 2006
Posts: 13
Thanks: 2
Thanked 0 Times in 0 Posts
dstu is an unknown quantity at this point
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);?>');
dstu is offline   Reply With Quote
Reply

Bookmarks

Jump To Top of Thread


Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +1. The time now is 08:39 AM.


Advertisement
Log in to turn off these ads.