...

View Full Version : Is it possible to create multiple entries from 1 form?



lumper
04-13-2012, 12:20 PM
If i were to create a form that captured a "Topic" that would then show another form wih a "Message" textarea and a date stamp, lets say and gave the option to "Save" or "New" where "New" would post this form and show the exact same form again, but would asign it the value of "Page 2" under that topic?

Is it possible?

I have played around with a query or 2 but have had little, actually, no success.
[CODE]
if ($_SERVER['REQUEST_METHOD'] == "POST")
$topic = $_POST ['topic'];
$page = array("id" => $_POST['pageID'], "msg_txt" => $_POST['message'], "page_num" => $_POST['dueDate']);

function page_number ($pager){
$pager = page_num;
foreach as $pager ($i=0; $i<($pager); $i++){
return $pager++;
}


}

[\CODE]

As you can see I have no idea what I am doing and am trying to finish this project by Monday morning / preffeerably Sunday evening :mad::confused:

Hopefully someone can help me .... PLEASE !!!!

Thank you

sunfighter
04-13-2012, 03:41 PM
Maybe someone that understands what you want will come along and answer this, but I don't have a clue as to what you want. Why not code out the two forms you want and tell us what, in the first form, keys the second form and what from the first form is entered into the second form and then what you want to do with the information these two forms collect?

tangoforce
04-13-2012, 03:50 PM
If i were to create a form that captured a "Topic" that would then show another form wih a "Message" textarea and a date stamp, lets say and gave the option to "Save" or "New" where "New" would post this form and show the exact same form again, but would asign it the value of "Page 2" under that topic?

Please don't be offended but in your enthusiasm to describe your ultimately cool idea, you've forgotten to slow down and think about the best way of describing it. To put that bluntly it isn't very clear what you're wanting. It might be crystal clear to yourself (but you know what you want already so your somewhat vague description makes sense to you) but to the rest of us you're mumbling on about a form having a second page from what I can tell.

bucket
04-13-2012, 08:11 PM
I think what he wants to do it, to continuously create new messages without have to go through multiple pages.

Its like the vbulletin 'Save and reload'

http://avchat.net/support/documentation/vb/vbulletin_add_new_template_content.png

Basically have 3 buttons, 'save', which returns back to the main page.

'save and reload' which creates a page, then returns that editor with the next avaliable page +1 to create and save.

'cancel' to scratch that page, and go back to the main.

I am unsure how to use 3 buttons, which might have to be done with javascript and can also add data to add another number to the previous page edited with a new blank textbox.

Did I explain it correctly?

lumper
04-14-2012, 09:52 AM
Thank you sunfighter and tangoforce - you are indeed correct, I could not see the trees for the forest:thumbsup:

OK, slowing down a bit here.
I would like to create an interface with 3 main Elements.


Topic Name Form (This is what the pages will fall under)
Creat "Page" Form (This form will have preset fields for input)
"Page" Explorer (A Tree View of Pages #1 - ...)


A user enters the topic and presses "Create" which in turn presents them with a "Create page" form which has several fields on it and 3 buttons :


save and new
clear form
save (Which will close the session)


Save and New will create a "page" - a "Page" is submitted to the Database, the Page Form is refreshed (Cleared) and the "Page" that was just submitted to the DB is reflected in the "Page Explorer" as an icon.

Selecting a "Page" in the explorer will allow you to move it up and down in the range of pages or edit it or delete it.

A new page can then be submitted and reflects as Page2 and so on until the "[Save]" button is pressed and the session ended.

When the session is ended a form reflecting the every Submitted Topic and the number of pages it contains.

I think better in pictures - I am a Graphic designer by trade so I have attached the basic kinda layout thing for you of the main Interface and the list interface.


Thans again for your help and criticism ... I really do appreciate it.

sunfighter
04-14-2012, 07:09 PM
This is not an easy task lumper. If you don't know how to program I suggest you go here and read up on what is needed when you need it. http://www.w3schools.com/html/default.asp Notice forms in the menu on the left under HTML Basic.

I would not start with multiple topics, but with a single topic with multiple pages. Your first image is where I would start. It's a two column page, leave the left column blank. Start on the Add a Page button to open a div much bigger then what you have shown and put the clear- save -edit buttons on that div. Code those buttons and save page to a file for now. Then you can work on the left column.

That's enough for starters. You can always ask for help as you go, but we would like you to post the code your having problems with. We help, not give you code.
Good Luck.

lumper
04-15-2012, 09:12 AM
Thank you Sunfighter, I have a little piece of code that I am working on, I was more looking for a way to use a form recursively under 1 topic. I will go through the Tut you have suggested and post my code in a bit.



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum