Skip to main content
August 18, 2011
Answered

problems with form refresh.

  • August 18, 2011
  • 1 reply
  • 2442 views

I have been racking my brain trying to figure out how to get something to work with a form.

This is the form that is going to be used..

<cfform action="Insert.cfm" name="Create" target="_blank">

from this it should open the insert.cfm as I have a report to open at the end of insert page. This works fine.

<cfreport format="pdf" template="Detail_Printable.cfm" query="Qdetail">
</cfreport>

But I have a problem with the form. I need it to refresh as I dont want the user to have the option of submitting the form again, with out the new data being available.

Hope that makes sense.

Thank you

James

    This topic has been closed for replies.
    Correct answer Adam Cameron.

    Adam, I guess the Java is what I am needing help with.

    Thank you


    OK, first things first: it's not Java.  It's JavaScript.  They are two completely different and unrelated things (despite the similarity in name).

    http://en.wikipedia.org/wiki/Java_%28programming_language%29

    http://en.wikipedia.org/wiki/JavaScript

    Second, google "javascript onsubmit handler".  There is stacks of information & tutorials & guidance out there already, so there's no point me repeating it here.

    Once you get your brain around how the onsubmit handlers work, google "javascript onsubmit open new window" and read some of the stuff about how to do that.  All the info you need is already there.  Indeed there is exactly the answer you need on the first page of results.

    If you get to to the point of writing some code and need help with it, then post back.  But you should be able to solve all this with Google and rolling up your sleeves ;-)

    --

    Adam

    1 reply

    Inspiring
    August 18, 2011

    If you need to control how the browser behaves, you need to do it with JavaScript.  Create an onsubmuit handler; submit your form to the new window; and then relocate the parent window to somewhere else.

    --

    Adam

    August 18, 2011

    I have tried this Java on the opened page (_blank)

    <BODY onLoad="window.opener.location.reload();">

    but it does not seem to work at all.. Doesnt even try to refresh the original page.

    Just to try and clarify my problem a little.

    I have 2 pages.

    Original Page 1, this is the one with the Form on it.

    Insert and Document Page 2.

    SO when a user clicks on the submit button on page 1 it opens page 2 and does an insert and then rolls to a report..

    But when this happens I need the Original Page one to refresh.

    Thank you

    Inspiring
    August 18, 2011

    Yep, I understand it.

    See my previous post (which you are replying to, but seem to not have read).

    --

    Adam