I tried to make a drop down search as its here in the left side
http://www.indianartcollectors.com/v...s.php?arid=818
my trial is here:
http://www.jalsaghar.com/test.php
but it's not working... can anyone suggest what's wrong?
| SitePoint Sponsor |
I tried to make a drop down search as its here in the left side
http://www.indianartcollectors.com/v...s.php?arid=818
my trial is here:
http://www.jalsaghar.com/test.php
but it's not working... can anyone suggest what's wrong?
Any relevant php code?
Saul
whatever i have done can be seen in the Source Code of browser ..... nothing much in php .......
Then what is wrong with it?
Saul
on submitting I m trying to call function displayArtist()
which I have written inside HEAD
<SCRIPT>
function displayArtist()
{
<?php
echo("1234");
?>
}
</SCRIPT>
but it seems to be not calling the function......
here's the complete code:
PHP Code:<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<html>
<head>
<title>
Jalsaghar: Artist and their Works
</title>
<SCRIPT>
function displayArtist()
{
<?php
echo("1234");
?>
}
</SCRIPT>
</head>
<body>
<?php
$sql = $db_object->query("Select distinct artistid from image");
echo("<form name=\"frmSearch\" action=\"\" method=\"POST\" enctype=\"multipart/form-data\" onsubmit=\"javascript:displayArtist();\">");
echo("<select name=\"vchArtist\">");
while($row = $sql->fetchRow())
{
$ArtistId = $row["artistid"];
echo("<option value=\"$ArtistId\">$ArtistId</option>");
}
echo("</select>");
echo("<input type=\"submit\" name=\"submit\" value=\"Submit\">");
echo("</form>");
?>
</body>
</html>
Look at the source, you've got:
All you've got is a syntax error there. You want to run a php script server-side, look up Ajax.Code:function displayArtist() { 1234 }
Saul
Try this article: http://www.sitepoint.com/article/bui...-ajax-web-apps
Saul
Bookmarks