Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 7 of 7
  1. #1
    New Coder
    Join Date
    Apr 2012
    Posts
    51
    Thanks
    19
    Thanked 0 Times in 0 Posts

    Exclamation Is it possible to create multiple entries from 1 form?

    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

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

    Thank you

  • #2
    Senior Coder
    Join Date
    Jan 2011
    Location
    Missouri
    Posts
    4,316
    Thanks
    23
    Thanked 613 Times in 612 Posts
    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?

  • Users who have thanked sunfighter for this post:

    lumper (04-14-2012)

  • #3
    Senior Coder
    Join Date
    Feb 2011
    Location
    Your Monitor
    Posts
    4,344
    Thanks
    60
    Thanked 527 Times in 514 Posts
    Blog Entries
    4
    Quote Originally Posted by lumper View Post
    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.
    See my new CodingForums Blog: http://www.codingforums.com/blogs/tangoforce/

    Many useful explanations and tips including: Cannot modify headers - already sent, The IE if (isset($_POST['submit'])) bug explained, unexpected T_CONSTANT_ENCAPSED_STRING, debugging tips and much more!

  • Users who have thanked tangoforce for this post:

    lumper (04-14-2012)

  • #4
    Regular Coder
    Join Date
    Sep 2008
    Posts
    705
    Thanks
    8
    Thanked 17 Times in 16 Posts
    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'



    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?
    MY MSN: Sith717@Hotmail.com
    PHP, HTML, and CSS Coding, Logo and Web Design - Professionally done.
    PM me anytime for HTML, PHP or web design help. I will be glad to help you out.

  • Users who have thanked bucket for this post:

    lumper (04-14-2012)

  • #5
    New Coder
    Join Date
    Apr 2012
    Posts
    51
    Thanks
    19
    Thanked 0 Times in 0 Posts
    Thank you sunfighter and tangoforce - you are indeed correct, I could not see the trees for the forest

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

    1. Topic Name Form (This is what the pages will fall under)
    2. Creat "Page" Form (This form will have preset fields for input)
    3. "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 :

    1. save and new
    2. clear form
    3. 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.
    Attached Thumbnails Attached Thumbnails Is it possible to create multiple entries from 1 form?-interface_1.gif   Is it possible to create multiple entries from 1 form?-interface_2.gif  

  • #6
    Senior Coder
    Join Date
    Jan 2011
    Location
    Missouri
    Posts
    4,316
    Thanks
    23
    Thanked 613 Times in 612 Posts
    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.

  • #7
    New Coder
    Join Date
    Apr 2012
    Posts
    51
    Thanks
    19
    Thanked 0 Times in 0 Posts
    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.


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •