SitePoint Sponsor

User Tag List

Results 1 to 3 of 3

Thread: submit page

  1. #1
    SitePoint Enthusiast
    Join Date
    Sep 2001
    Location
    Northern Virginia
    Posts
    48
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    submit page

    Ok here is my issue:
    i have my cold fusion page doing multiple tasks depending on what is displayed. the form has an action of page1. if the if certain sumbit buttons display at the bottom of the page, i need that submit button to redirect the submit to page2.

    because the form has an action of page1, can i redirect to page2 using the submit button?

    thanks
    dan

  2. #2
    SitePoint Guru Vincent Puglia's Avatar
    Join Date
    Feb 2000
    Location
    where the World once stood
    Posts
    700
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Hi dfred,

    (long time no see)

    you can change your action in javascript, but you need to remove it from the form and get rid of the submit button.

    for example:

    <form>
    .......
    <input type='button' value='submit' onclick='sendIt(this.form)'>
    </form>

    function sendIt(formObj)
    {
    if (someVariableIsTrue)
    formObj.action = 'page1'
    else
    formObj.action = 'page2'
    formObj.submit()
    }

    Vinny
    Where the World Once Stood
    the blades of grass
    cut me still

  3. #3
    SitePoint Enthusiast
    Join Date
    Apr 2003
    Location
    Maryland, USA
    Posts
    41
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Assuming you are uisng CF to determine what submit button to display, you can use the same logic to determine where to redirect the pages using <CFLOCATION URL="http://www.sitepoint.com">


Bookmarks

Posting Permissions

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