[PHP-DB] javascript question

2004-03-08 Thread Gamze Baaran
Hi everyone;

First of all I'm sorry maybe I musn't send this mail to this list but I
think that someone can help me. Here is my problem:

I use pear templates. In my html template file there is an javascript like
this:

function validateAll (objForm){
if (objForm.comp_prg.selectedIndex == 0) {
alert (You must choose something);
return false;
}
  Return true;
}

This code is true. But I want to use php variable in this code. Alert
sentence must be a php_variable. I try

Alert(php $message?); or
Alert(php echo$message;*);

But I it isn't work. Can anybody help me??

-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP-DB] javascript question

2004-03-08 Thread jeffrey_n_Dyke
   
 
  Gamze Baaran
 
  [EMAIL PROTECTED]To:   Php-Db ([EMAIL PROTECTED]) 
[EMAIL PROTECTED] 
  aat.com.tr  cc: 
 
   Subject:  [PHP-DB] javascript question  
 
  03/08/2004 08:49 
 
  AM   
 
   
 
   
 








Hi everyone;

First of all I'm sorry maybe I musn't send this mail to this list but I
think that someone can help me. Here is my problem:

I use pear templates. In my html template file there is an javascript like
this:

function validateAll (objForm){   if
(objForm.comp_prg.selectedIndex == 0) {
 alert (You must choose something);
 return false;
 }
  Return true;
}

This code is true. But I want to use php variable in this code. Alert
sentence must be a php_variable. I try

Alert(php $message?); or
Alert(php echo$message;*);


The tags are not valid php opening/closing tags, you alse have PHP and
Javascript sytax errors.  probably php-general is the best place for this
post.  Although this should work.

if you don't use a qoute(') in JS alerts then JS will think its a variable
name and not a string to be alerted.
Alert('?php echo $message; ?'); or
Alert('?php echo $message; ?');

hth
Jeff
---
But I it isn't work. Can anybody help me??

--
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php





--
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP-DB] javascript question

2004-03-08 Thread Ignatius Reilly
Maybe you forgot a ?:
Alert(?php echo $message ; ?); or
 ^^^
Ignatius
_
- Original Message -
From: Gamze Baaran [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Sent: Monday, March 08, 2004 2:49 PM
Subject: [PHP-DB] javascript question


 Hi everyone;

 First of all I'm sorry maybe I musn't send this mail to this list but I
 think that someone can help me. Here is my problem:

 I use pear templates. In my html template file there is an javascript like
 this:

 function validateAll (objForm){
 if (objForm.comp_prg.selectedIndex == 0) {
 alert (You must choose something);
 return false;
 }
   Return true;
 }

 This code is true. But I want to use php variable in this code. Alert
 sentence must be a php_variable. I try

 Alert(php $message?); or
 Alert(php echo$message;*);

 But I it isn't work. Can anybody help me??

 --
 PHP Database Mailing List (http://www.php.net/)
 To unsubscribe, visit: http://www.php.net/unsub.php



-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP-DB] javascript question

2004-03-08 Thread Gamze Baaran
When I use this it isn't work an there is error but  can't see it with
internet explorer. I can't catch it :(

Alert('?php echo $message; ?'); or
Alert('?php echo $message; ?');

--
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP-DB] javascript question

2004-03-08 Thread Viorel Dragomir
alert('?=$message?');

// case sensitive

- Original Message - 
From: Gamze Baaran [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Sent: Monday, March 08, 2004 4:09 PM
Subject: [PHP-DB] javascript question


When I use this it isn't work an there is error but  can't see it with
internet explorer. I can't catch it :(

Alert('?php echo $message; ?'); or
Alert('?php echo $message; ?');

-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php