Good morning, my name is Concetta and hopefully you can help me. I have
a problem with Javascript and PHP.
Here is my situation:
Unit Code : |--------| Unit Description :
|-----------------|
Address : |-----------|
After I insert this command
echo "<INPUT TYPE=text NAME=codice_unit SIZE=2
onChange=UpdateDescriptionUnit()>";
for example
Unit Code : |----01--| I want to write O1 (not select from a menu)
for the Unit Code and after I click TAB or ENTER, I want the Unit
Description: |--sezione ced--| to appear automatically.
Then, I want the cursor to go to a postion justified left in the
Address: |-|------|;
I have this table with the fields
---------------------------------
| codice_unit | desc_unit |
---------------------------------
| 01 | sezione ced |
---------------------------------
| 02 | sezione sismos |
---------------------------------
| 03 | sezione arp |
---------------------------------
| 04 | sezione matti |
---------------------------------
Extract the unit description with the code source:
<?
$risultato = db_query("SELECT codice_unit, desc_unit FROM
UNITA_ORGANICHE where codice_unit='$codice_unit'");
$nr = db_numrows($risultato);
$i=0;
while ($i<$nr):
$codice_unit= db_result($risultato,$i,"codice_unit");
$desc_unit = db_result($risultato,$i,"desc_unit");
$desc_r_unit = db_result($risultato,$i,"desc_r_unit");
echo "$desc_unit<br>";
$i++;
endwhile;
?>
For example, $codice_unit =01 returns $desc_unit=sezione ced
I want all the fields to appear on one page without reloading. I am not
able to write the Javascript function and extact the function
UpdateDescriptionUnit(). Will you please help me? I have looked at your
example but I am not able to write the procedure. I hope I have clearly
presented this problem. I would like the code for both Javascript and
PHP. Thank you very much.
Sincerely,
Concetta Felli
a problem with Javascript and PHP.
Here is my situation:
Unit Code : |--------| Unit Description :
|-----------------|
Address : |-----------|
After I insert this command
echo "<INPUT TYPE=text NAME=codice_unit SIZE=2
onChange=UpdateDescriptionUnit()>";
for example
Unit Code : |----01--| I want to write O1 (not select from a menu)
for the Unit Code and after I click TAB or ENTER, I want the Unit
Description: |--sezione ced--| to appear automatically.
Then, I want the cursor to go to a postion justified left in the
Address: |-|------|;
I have this table with the fields
---------------------------------
| codice_unit | desc_unit |
---------------------------------
| 01 | sezione ced |
---------------------------------
| 02 | sezione sismos |
---------------------------------
| 03 | sezione arp |
---------------------------------
| 04 | sezione matti |
---------------------------------
Extract the unit description with the code source:
<?
$risultato = db_query("SELECT codice_unit, desc_unit FROM
UNITA_ORGANICHE where codice_unit='$codice_unit'");
$nr = db_numrows($risultato);
$i=0;
while ($i<$nr):
$codice_unit= db_result($risultato,$i,"codice_unit");
$desc_unit = db_result($risultato,$i,"desc_unit");
$desc_r_unit = db_result($risultato,$i,"desc_r_unit");
echo "$desc_unit<br>";
$i++;
endwhile;
?>
For example, $codice_unit =01 returns $desc_unit=sezione ced
I want all the fields to appear on one page without reloading. I am not
able to write the Javascript function and extact the function
UpdateDescriptionUnit(). Will you please help me? I have looked at your
example but I am not able to write the procedure. I hope I have clearly
presented this problem. I would like the code for both Javascript and
PHP. Thank you very much.
Sincerely,
Concetta Felli