Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. Web Development
  3. Form Method

Form Method

Scheduled Pinned Locked Moved Web Development
javajavascripthelpquestion
2 Posts 1 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • T Offline
    T Offline
    Tyler45
    wrote on last edited by
    #1

    Hi to All! I have one form! and I have to do 2 process for this form. one of them is Submit another is preview. But i have to do preview in new window, submit is on same window. I found this on codeproject here is the code below function OnButton1() { document.Form1.action = "onizleme.jsp" document.Form1.target = "_blank"; // Open in a new window document.Form1.submit(); // Submit the page return true; } function OnButton2() { document.Form1.action = "gonder.jsp" document.Form1.submit(); // Submit the page return true; } You need Javascript enabled for this to work Your Name But problem is that: If i first click submit and second i click preview it is ok but if i first click preview and then second i click submit button, submit process open in new window. How can i handle this. Thanks for your helps Best Regards

    T 1 Reply Last reply
    0
    • T Tyler45

      Hi to All! I have one form! and I have to do 2 process for this form. one of them is Submit another is preview. But i have to do preview in new window, submit is on same window. I found this on codeproject here is the code below function OnButton1() { document.Form1.action = "onizleme.jsp" document.Form1.target = "_blank"; // Open in a new window document.Form1.submit(); // Submit the page return true; } function OnButton2() { document.Form1.action = "gonder.jsp" document.Form1.submit(); // Submit the page return true; } You need Javascript enabled for this to work Your Name But problem is that: If i first click submit and second i click preview it is ok but if i first click preview and then second i click submit button, submit process open in new window. How can i handle this. Thanks for your helps Best Regards

      T Offline
      T Offline
      Tyler45
      wrote on last edited by
      #2

      Sorry to all :) because i have found code that when i was post this message here is the answer var PreviewWnd = null; function Preview() { if (Submitted) return false; PreviewWnd = open("","preview","toolbar=no,resizable=yes,scrollbars=yes,directories=no,menubar=no,width=400,height=300"); document.MessageForm.action = "onizleme.jsp"; document.MessageForm.target = "preview"; return true; } var Submitted = false; function Submit() { document.MessageForm.action = "gonder.jsp"; document.MessageForm.target = "_top"; Submitted = true; return true; } Your Name

      1 Reply Last reply
      0
      Reply
      • Reply as topic
      Log in to reply
      • Oldest to Newest
      • Newest to Oldest
      • Most Votes


      • Login

      • Don't have an account? Register

      • Login or register to search.
      • First post
        Last post
      0
      • Categories
      • Recent
      • Tags
      • Popular
      • World
      • Users
      • Groups