Submit Your Article Webforumz RegistrationAnnouncements Contact Webforumz StaffContact
Home Resources Blogs Meet the Team Contact Register
 

Go Back   WebForumz.com > The Code > PHP

Reply
 
LinkBack Thread Tools
Old February 13th, 2007, 08:09 AM   #1
New Member
 

Join Date: Feb 2007
Location: canada
Age: 43
Posts: 4
Thanks: 0
Thanked 0 Times in 0 Posts
Rep Altering Power: 0 plooner is on a distinguished road
onClick and submit to new URL

Hi,
I'm trying to put together a 'simple' form but am needing some help...

Can you combine the OnClick event and Submit together?

Here's what I want to do:
A text box on the form asking for a postal code.
Have the user click one of two radio boxes indicating whether they speak english or french.
When finished they click a 'submit' button, which redirects the user to either the english or french page, at the same time submitting the postal code information to me.

It was suggested I use either PHP or ASP, instead of javascript...
Is this possible???
Thanks.
plooner is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
Old February 19th, 2007, 04:53 AM   #2
Reputable Member
 

Join Date: May 2006
Location: Warrington, UK
Posts: 440
Thanks: 0
Thanked 0 Times in 0 Posts
Rep Altering Power: 0 Accurax is on a distinguished road
Re: onClick and submit to new URL

First of all, use php.

This shouldnt actually be that difficult, you will need to do some research into $_POST, mail(); and also into php if / else statements.

Basically, your form would collect the data, and post it to a series of php commands, either on the same page or a seperate "processing" page depending on your style.

The $_POST variables would then have to be converted to $foo (normal variables).

Important thing to realises is that radio buttons return "1" if they are selected & "0" if they are empty.

Knowing that you can create a php if / else statement that checks which radio button is selected and forwards the user to the correct page whilst simultaneously sending you the info in a mail.... or if u wanna be real shexy, stick it in a database

Hope this helps, if u get stuck give me a shout
Accurax is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
Old February 19th, 2007, 05:44 PM   #3
Highly Reputable Member
 
masonbarge's Avatar
 

Join Date: Jan 2006
Location: Atlanta GA
Posts: 649
Thanks: 0
Thanked 0 Times in 0 Posts
Rep Altering Power: 0 masonbarge will become famous soon enough
Re: onClick and submit to new URL

My choice might well be to make a little rectangular button that says "francais" and links to a different page. But you could easily have two submit buttons, with "English" and "Francais" (or "Click here" and "Pressez-ci" or something).

PHP (or asp/cgi) is better anyway, since some people have js disabled.
masonbarge is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
Old February 20th, 2007, 06:00 AM   #4
Reputable Member
 

Join Date: May 2006
Location: Warrington, UK
Posts: 440
Thanks: 0
Thanked 0 Times in 0 Posts
Rep Altering Power: 0 Accurax is on a distinguished road
Re: onClick and submit to new URL

Mason has a point....... just let them select the language they want
Accurax is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
Old February 20th, 2007, 05:40 PM   #5
New Member
 

Join Date: Feb 2007
Location: canada
Age: 43
Posts: 4
Thanks: 0
Thanked 0 Times in 0 Posts
Rep Altering Power: 0 plooner is on a distinguished road
Re: onClick and submit to new URL

I agree, 2 hyperlinks to separate pages seems to be the easiest way, I must remember...KISS!
Thanks!
plooner is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
Reply

Bookmarks

Tags
onclick , submit


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Similar Threads
Thread Thread Starter Forum Replies Last Post
OnClick Behaviour Monie JavaScript 3 October 22nd, 2007 10:13 PM
submit many forms - auto submit the same form many times divs JavaScript 0 May 24th, 2007 06:10 AM
OnClick to new URL and Submit together plooner JavaScript 2 February 13th, 2007 07:48 AM
Need help on an onclick function DaveKenroy JavaScript 3 January 28th, 2007 07:31 AM
onclick function tomd1985 JavaScript 0 March 13th, 2006 02:20 PM


Search Engine Optimization by vBSEO 3.2.0 RC8