PHP Classes

Dynamic Form Input Menu

Recommend this page to a friend!

      Expandable Menu  >  All threads  >  Dynamic Form Input Menu  >  (Un) Subscribe thread alerts  
Subject:Dynamic Form Input Menu
Summary:HTML option from file, feed other Input with data same line
Messages:2
Author:Benoit Blais
Date:2006-04-05 18:44:54
Update:2006-04-06 16:46:52
 

  1. Dynamic Form Input Menu   Reply   Report abuse  
Picture of Benoit Blais Benoit Blais - 2006-04-05 18:44:54
Hi,

I am a beginner in this language and I have a text file (test.txt)like this:

Name;Mail;PhoneNumber;
Test1;[email protected];111-111-1111;
Test2;[email protected];222-222-2222;
Test3;[email protected];333-333-3333;
Test4;[email protected];333-333-3333;
...

I am able to feed a FORM SELECT with this code:

<?
print("<select name='Person'>");
$file = fopen("test.txt", "rt") ;
while(!feof($file))
{
fscanf($file , "%[^;];%[^;];%[^;];", $Name, $Mail, $Phone) ;
print("<option value=$Name>$Name");
}
fclose($file) ;
print("</select>");
?>

Is there's a way that when the user select a name like Test3, it feed other Input on my web page with the rest of data on the same line?

Exemple: If I choos Test3, it will write automatically his email on a Input box on the same line and his phone number in other input box?

Thanks!

  2. Re: Dynamic Form Input Menu   Reply   Report abuse  
Picture of Russell Nash Russell Nash - 2006-04-06 16:46:52 - In reply to message 1 from Benoit Blais
I soved the proble for you using javascript and adding a index to the front of your text file, give me an email and i will send you a working script in a zip file. you can get my email from my profile or use:

[email protected]

ps
i cannot understand what this has to do with the expandable menu though