Integrated PHP adn Javascript

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
S_henry
Forum Contributor
Posts: 148
Joined: Sun Jan 25, 2004 10:25 pm
Location: M'sia

Integrated PHP adn Javascript

Post by S_henry »

Hi guys,
In my PHP page, I have 1 Javascript function to compare the value of the textbox with the value in database. In my opinion I have to use PHP in my Javascript function. PHP will be used to retrieve data from database and it will be compared to the value of the textbox (document.form1.txtTest.value;) in my Javascript function. The problem is I don't know how to do it. It always get error. Anybody can help me pls? Thanks.

Example of Javascript function:

function test() {
<?php
$a = ?>document.form1.txtTest.value; <?php ;
?>
alert('<?php echo $a ?>');
}
Post Reply