PDA

View Full Version : Need help with webform


spies0923
03-01-2011, 04:53 AM
Hi all, I urgently need help with a web form that I'm trying to create. Ive searched google for hours now and cant find any answers. the form is for ordering stock internally within the company and when submitted it should be emailed to me in excel format with the users name as the file name. The form should look something like this

[drop down menu] (list of usernames)
[drop down menu] (list of departments)
[drop down menu] (list of items) [text box] (quantity) [button] (to add another drop down menu below)

[submit button]

What I'm struggling most with is that button to add an extra drop down menu of the items list with another button to add more drop down menus.
I hope I've explained what I want clearly

Thanx in advance:)

Corrosive
03-01-2011, 07:30 AM
You just need to toggle using javascript I think. Try; http://www.dustindiaz.com/seven-togglers/ Not sure about getting output in excel format though.

edbr
03-01-2011, 08:08 AM
can export as csv file

edbr
03-01-2011, 08:12 AM
http://us2.php.net/manual/en/function.fputcsv.php might help

spies0923
03-01-2011, 11:56 AM
Thanks for the quick reply
I'm kind of a noob when it comes to coding, could you possibly explain in more detail

davidj
03-01-2011, 12:13 PM
Look at PHP fwrite (http://php.net/manual/en/function.fwrite.php)

This will help create a CSV which will open in excel

You could look at storing your items in a database which will make it far better and easier to update. If you did this you can create a CSV directly from MYSQL using...

SELECT field1,field2,field3
FROM table
INTO OUTFILE '/path/orders.csv'
FIELDS TERMINATED BY ','
ENCLOSED BY '"'
LINES TERMINATED BY '\n'