Passing a title from page 1 to a form field

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
Chaal
Forum Newbie
Posts: 14
Joined: Mon Sep 08, 2003 10:15 am

Passing a title from page 1 to a form field

Post by Chaal »

Hi,

Just found this site. It's great :)

I am somewhat a newb here so please be gentle with me :)

I have a page that shows vacancies, now what I would like to do is be able to click a link to the online application form, but when I do that it takes the job title and puts it in the correct form field on the online application form.

Is this easy ti do?

I don't need it going to a database or anything.

Thanking you
Chaal
m3rajk
DevNet Resident
Posts: 1191
Joined: Mon Jun 02, 2003 3:37 pm

Post by m3rajk »

have you used forms before?
User avatar
JayBird
Admin
Posts: 4524
Joined: Wed Aug 13, 2003 7:02 am
Location: York, UK
Contact:

Post by JayBird »

make this the link to your application form

Code: Select all

<a href="somefile.php?title=someJobTitle>Apply Online</a>
Then on the page with your form, in the text field

Code: Select all

<input type="text" name="jobTitle" value="<? echo $_GET['title'] ?>">
Shoudl work a treat

Mark
Chaal
Forum Newbie
Posts: 14
Joined: Mon Sep 08, 2003 10:15 am

Post by Chaal »

Hey thanks for that.

I will give it a try :)

By the way can this be used with more than 1 form field?

All the best
Chaal
User avatar
JayBird
Admin
Posts: 4524
Joined: Wed Aug 13, 2003 7:02 am
Location: York, UK
Contact:

Post by JayBird »

Chaal wrote: By the way can this be used with more than 1 form field?
You sure can!

Have a bash with the example i gave you, then if you have any more problems, just post here an we will try and help ya out.

Mark
Chaal
Forum Newbie
Posts: 14
Joined: Mon Sep 08, 2003 10:15 am

Post by Chaal »

So on the page I would put something like:

Code: Select all

<a href="somefile.php?title=someJobTitle&ref=somereference>Apply Online</a>
Thanks a bunch for the guidance :)
User avatar
JayBird
Admin
Posts: 4524
Joined: Wed Aug 13, 2003 7:02 am
Location: York, UK
Contact:

Post by JayBird »

yup, you got it ;)
Chaal
Forum Newbie
Posts: 14
Joined: Mon Sep 08, 2003 10:15 am

Post by Chaal »

Cool,

Thanks for your help :)
User avatar
JayBird
Admin
Posts: 4524
Joined: Wed Aug 13, 2003 7:02 am
Location: York, UK
Contact:

Post by JayBird »

no problem mate.

You may also wanna read this http://www.devnetwork.net/forums/viewtopic.php?t=511

Mark
Chaal
Forum Newbie
Posts: 14
Joined: Mon Sep 08, 2003 10:15 am

Post by Chaal »

Hi there,

I think I have run into a problem with the reference number idea. If this is manually entered on the first page say, ref:2003 I am not sure how I would actually pull that into the form as its not gonna be found using:

Code: Select all

<a href="somefile.php?title=someJobTitle&ref=somereference>Apply Online</a>
I guess I would need to wrap the reference in a tag of some sort.

Not 100% sure here.

Thanks
Post Reply