You are here: Re: [PHP] dependable combo boxes with mysql database (Solved) « PHP « IT news, forums, messages
Re: [PHP] dependable combo boxes with mysql database (Solved)

Posted by Bhoomi Vora on 11/14/05 19:09

I have got it done.
Below is the code:
-------------------------
<form name="from_service" method="post">
<FONT style="FONT-SIZE:12pt" color="#00008B"
face="Courier New"><B>Service</B></FONT>
</DIV>

<select name="D1" size="1"
style="position:absolute;left:230px;top:68px;z-index:7"
onChange="form_service.submit();">
<?php
display_db_combo("service_master","service_name",$conn);

$ser=$_POST['D1'];
if ($ser == ""){

print("<option selected>Select Service</option>");
}
else {

print("<option selected>$ser</option>");
}
?>
</select>

<DIV style="position:absolute; left:65px; top:106px;
width:83px; height:22px; z-index:4" align="left"
valign="top">
<FONT style="FONT-SIZE:12pt" color="#00008B"
face="Courier New"><B>Product</B></FONT>
</DIV>
<select name="D2" size="1"
style="position:absolute;left:230px;top:108px;z-index:8"
onChange="form_service.submit();">
<?php
display_db_combo1("service_master","service_id","service_name","product_master","product_name",$conn);

$ser=$_POST['D1'];
$prd=$_POST['D2'];

$a='Select Product';

if ($prd == ""){

print("<option selected>$a</option>");
}
else {
print("<option selected>$prd</option>");
}

?>
</select>

<DIV style="position:absolute; left:65px; top:152px;
width:103px; height:44px; z-index:5" align="left"
valign="top">
<FONT style="FONT-SIZE:12pt" color="#00008B"
face="Courier New"><B>Nature of Problem</B></FONT>
</DIV>
<select name="D3"
style="position:absolute;left:230px;top:170px;z-index:9"
size="1" onChange="form_service.submit()";>
<?php
display_db_combo2("product_master","product_id","product_name","problem_products","problem",$conn);


$prb=$_POST['D3'];
$prd=$_POST['D2'];


if ($prb == "" || $prd == "Select Product") {
print("<option selected>Select Problem</option>");
}

else {
print("<option selected>$prb</option>");
}

?>
</select>
</form>
---------------------------------------------
regards,

Bhoomi

--- "Pranav Negandhi (concept-I)"
<pranav@concept-i.co.in> wrote:

> This might be slightly OT on this list, but here
> goes nothing.
>
> 1. Submit the form when the user shifts focus from
> D1 using Javascript's
> onBlur event
> 2. On the server side, use PHP to retrieve the
> values for D2 and
> generate the page again
> 3. Repeat 1 & 2 when the value of D2 changes.
>
> HTH
> Pranav
> www.concept-i.co.in
>
>
> Bhoomi Vora wrote:
> > Hello All,
> >
> > I have a php page which contains three combo
> boxes.
> > The first one will have the value
> >
> > from the mysql database table on page load itself.
> >
> > Then depending upon the value selected in the
> first
> > combobox the second combo box
> >
> > should be populated with the respective values
> from
> > another mysql database table, and
> >
> > once again depending upon the value selected in
> second
> > combobox the third combobox
> >
> > should be populated with the respective values
> from
> > one more different database table.
> >
> > I have read through mailing list and also searched
> in
> > google and found that it can be
> >
> > done with javascript onblur function but nothing
> is
> > working. Here is the code:
> .....d similarly
> > D3 should be populated on event like 'onblur' to
> D2.
> >
> > Pl. give me the exact code or proper guideline how
> > should I accomplish this on the same page.
> >
> > Appreciate your replies.
> >
> > Thanks and regards.
> >
> > BJV
> >
> >
> >
> > __________________________________
> > Yahoo! FareChase: Search multiple travel sites in
> one click.
> > http://farechase.yahoo.com
> >
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>




__________________________________
Yahoo! FareChase: Search multiple travel sites in one click.
http://farechase.yahoo.com

 

Navigation:

[Reply to this message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация