One form, two actions?

This is a discussion on "One form, two actions?" within the Web Page Design section. This forum, and the thread "One form, two actions? are both part of the Design Your Website category.



Go Back   Webforumz.com > Main Forums > Design Your Website > Web Page Design

Notices


Reply
 
LinkBack Thread Tools
  #1 (permalink)  
Old Jan 21st, 2008, 18:11
Junior Member
Join Date: Jan 2008
Location: Reykjavik
Posts: 30
Thanks: 0
Thanked 0 Times in 0 Posts
One form, two actions?

Hi, I've searched the forum with no luck.
I have a HTML page that has one form, but as of now would require two actions.

I'm using multiple text input fields that all have the same action (link to php), but I also would like to have the option for the USER to add more 'textarea' fields with headlines of his liking.

I found this neat solution for adding 'textarea' fields, but that has another action than I´m using. And I would like to avoid having to split this page in two!

Here is a sample of what I´m currently working on:
HTML: Select all
<FORM METHOD=POST ACTION="form_dyr.php" enctype="multipart/form-data">

<input type="text" name="form_a" /> //text field 1
<input type="text" name="form_b" /> //text field 2

<input type="radio" name="utrymingar1" value="A" /> // Radio button 1
<input type="radio" name="utrymingar2" value="B" /> // Radio button 2
<input type="radio" name="utrymingar3" value="C" /> // Radio button 3

<select name="select_fra" id="select_1"> // Menu select 1
                        <option>A</option>
                        <option>B</option>

<input type="file" name="mynd_dyr" id="mynd_dyr" accept="image/*" /> // File upload 1
And then here is the new action that has to be added (see also link above):
HTML: Select all
<form method="post" action="/cgi-bin/show_params.cgi">

    <span id="writeroot"></span>

    <input type="button" id="moreFields" value="Give me more fields!" />
    <input type="submit" value="Send form" />

</form>
Does anybody have a solution for these two actions?
The second action is dynamic (page doesn't reload) so running both actions trough a javascript might not be any help, or will it?

If there is a different approach for adding teaxt areas , please feel free to comment.

Last edited by skuliaxe; Jan 21st, 2008 at 19:42.
Reply With Quote

  #2 (permalink)  
Old Jan 23rd, 2008, 14:05
spinal007's Avatar
Moderator
Join Date: Mar 2004
Location: Good Ol'London
Age: 22
Posts: 1,620
Blog Entries: 1
Thanks: 0
Thanked 2 Times in 2 Posts
Send a message via ICQ to spinal007 Send a message via MSN to spinal007 Send a message via Yahoo to spinal007 Send a message via Skype™ to spinal007
Re: One form, two actions?

it would help to explain what you are trying to achieve.
but I'm guessing you could simply redirect to /cgi-bin/show_params.cgi from the first page.

In form_dyr.php, after you've done what you had to do, use this code:
<?php header( 'Location: /cgi-bin/show_params.cgi' ) ; ?>
Last Blog Entry: Random String in Javascript (Apr 21st, 2008)
Reply With Quote
Reply

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
[SOLVED] 2 different actions, same form AdRock Web Page Design 5 Oct 11th, 2007 18:02
Need Help With Flash Actions manny4003 Flash & Multimedia Forum 6 Jul 5th, 2007 23:17
2 actions on a button fishbyname Web Page Design 1 Nov 16th, 2006 14:25
Two form actions on pressing submit button? AndyP Web Page Design 7 Jul 25th, 2005 16:25
text actions benbacardi Flash & Multimedia Forum 1 May 14th, 2004 22:14


All times are GMT. The time now is 23:40.


Powered by vBulletin®
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.2.0 RC8
© 2003-2008 Webforumz.com : All Rights Reserved

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43