Forums

Auto fill form string

neilforrester 20 Sep, 2010
Hello,

I am creating a job website where each job has a reference number such as: job123

When a user views the job and decides to apply for it they click the apply button which will load a form. I want to include the job reference number in the form information automatically along with the other details that user might fill out. I believe this might involves SQL somehwere along the way???

There will be lots of jobs on the site so I don't want to have to create a form for each job.

I am willing to learn if someone can point me in the right direction please.

Many thanks in advance for any help given.

Best wishes,
Neil.
Max_admin 20 Sep, 2010
Hi,

You may include the job reference in the url to the form like &jobid=job123 in the url, then use this code in your form:
<?php echo JRequest::getVar('jobid', '');
to retrieve the job reference, in order to load more job details using this reference (assuming you have a jobs table with all jobs data and their references) yo will need some SQL code, this is posted in dozens of posts here, you need a "SELECT" statement

Regards,
Max
Max, ChronoForms developer
ChronoMyAdmin: Database administration within Joomla, no phpMyAdmin needed.
ChronoMails simplifies Joomla email: newsletters, logging, and custom templates.
neilforrester 24 Sep, 2010
Hi Max,

Thank you very much for getting back to me. I'll take a look into this further and see if I can get it working based on what you say. I'll let post back here on how I get on.

Thanks again for your advice.

Best wishes,
Neil.
This topic is locked and no more replies can be posted.