iEntry 10th Anniversary Webforumz RegistrationAnnouncements Contact Webforumz StaffContact
Home Resources Blogs Meet the Team Contact Register
 

Go Back   WebForumz.com > The Code > JavaScript

Reply
 
LinkBack Thread Tools
Old August 3rd, 2008, 06:39 PM   #1
New Member
 

Join Date: Aug 2008
Location: edinburgh
Posts: 2
Thanks: 1
Thanked 0 Times in 0 Posts
Rep Altering Power: 0 conradbf is on a distinguished road
different form submit actions

Hi,

I am having a problem with a form.

My submit button (<input type="submit">) currently has an onClick handler which executes an ajax request to update the database, returns false, and displays a simple updated message next to the button when complete.

The problem is that I have a link that I want to use to submit the form normally ( document.form.submit() ), ie post and navigate to a new page, but it wont work as long as the submit button is there.

I have tried reversing their roles but it doesn't help.

Any help would be greatly appreciated.

Thanks,
Conrad
conradbf 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 August 3rd, 2008, 08:01 PM   #2
Most Reputable Member
 

Join Date: Feb 2008
Location: In My Own Little World
Age: 15
Posts: 1,346
Blog Entries: 9
Thanks: 2
Thanked 45 Times in 45 Posts
Rep Altering Power: 0 CloudedVision is on a distinguished road
Re: different form submit actions

This is a quirk in javascript. If any of the form inputs are named "submit" submit() won't work. I'm assuming your button is name="submit", so change that and it should work.
__________________
Theron Luhn
CloudedVision 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 August 4th, 2008, 07:49 AM   #3
New Member
 

Join Date: Aug 2008
Location: edinburgh
Posts: 2
Thanks: 1
Thanked 0 Times in 0 Posts
Rep Altering Power: 0 conradbf is on a distinguished road
Re: different form submit actions

Thats great thanks. Incidentally, the id was also "submit" and i had to change both to make it work.

Cheers
Conrad
conradbf 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


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
One form, two actions? skuliaxe HTML, XHTML and CSS 1 January 23rd, 2008 11:05 AM
[SOLVED] 2 different actions, same form AdRock HTML, XHTML and CSS 5 October 11th, 2007 03:02 PM
submit many forms - auto submit the same form many times divs JavaScript 0 May 24th, 2007 07:10 AM
how to submit form tobymather HTML, XHTML and CSS 13 April 17th, 2007 02:09 PM
Two form actions on pressing submit button? AndyP HTML, XHTML and CSS 7 July 25th, 2005 01:25 PM


Search Engine Optimization by vBSEO 3.2.0 RC8