Xanco Posted April 6, 2013 Share Posted April 6, 2013 (edited) Hello peoples. Right, what I'm trying to do is; you fill out a form that generates a HTML page (done with no problems) but you want to preview it before. So essentially, what I'm trying to do it submit a form, but opening another window in doing so, meaning that the entered information on the 1st page stays the same. Here's the code I'm trying: <form action="store_it.php" method="post" id="contact"> <fieldset> <label for="name" >The title of your page:*</label> <input type="text" name="name" value="<?php echo $name; ?>" placeholder="My project" id="name"> <br><label for="body" title="You may use HTML code in this box">The text for your page:*</label> <textarea onfocus="window.lstText=this;" name="body" value="<?php echo $body; ?>" id="body"></textarea><br> <input type="submit" value="Submit" name="submit" class="button" id="submit"><br> <input type="submit" value="Preview" onclick="window.open('store_it.php')"><br> </fieldset> </form> - Thanks, Xanco Edited April 6, 2013 by Xanco Quote Link to comment https://forums.phpfreaks.com/topic/276623-how-do-i-submit-my-form-in-a-new-window/ Share on other sites More sharing options...
BuildMyWeb Posted April 7, 2013 Share Posted April 7, 2013 im not sure what you are asking. but, i think this is not an HTML question so you might get better help elswhere. javascript is likely what you are after. i see that you are using that for your submission. if your concern is keeping data in their respective fields, you could use php sessions to store values and, isset(), assign them to each field. Quote Link to comment https://forums.phpfreaks.com/topic/276623-how-do-i-submit-my-form-in-a-new-window/#findComment-1423353 Share on other sites More sharing options...
Irate Posted May 3, 2013 Share Posted May 3, 2013 You can use Ajax to submit it without having to reload the browser page. But generally you would need PHP to make proper use of the form. Quote Link to comment https://forums.phpfreaks.com/topic/276623-how-do-i-submit-my-form-in-a-new-window/#findComment-1427897 Share on other sites More sharing options...
ginerjm Posted May 15, 2013 Share Posted May 15, 2013 I don't see the point of using a 2nd window to show the input while it's still on the old window. If your concern is not losing the input data after you have processed it (in case of an input error), your php code can very easily just return the original screen with the input and any needed error messages displayed. Personally - I would find an application to be a bit klutzy if I had to look at an intermediate screen in order to use it. Plus - popup windows like yours are generally frowned upon. Quote Link to comment https://forums.phpfreaks.com/topic/276623-how-do-i-submit-my-form-in-a-new-window/#findComment-1430090 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.