Long Form
Moderator: General Moderators
I am nearly done with my code, the only thing that I need to know how to do is get to get the name of the form, from the form tag.
i am hoping to be able to get the name "form1" as a variable in my php script.
How can I do this?
Code: Select all
<form action="a.php" method = "POST" name="form1" target="_blank" id="form1">How can I do this?
-
Stewsburntmonkey
- Forum Commoner
- Posts: 44
- Joined: Wed Aug 24, 2005 2:09 pm
I think the best thing to do would be to create a hidden input field and use it to store the name of the form.
Code: Select all
<input type="hidden" name="formName" value="form1">While working on this code I came across another problem. I have the php window that I resized in javascript because I could not find a way in PHP. And after the form is submitted, and checked to be filled I need to close the php window and set the parent window that has the form to another webpage.
I cannot use teh onsubmit in html because I have to check the form to be sure that all of the required fields are filled, and this could take several submits. I am just looking for a PHP command to close the current window, and change the parent, and also, if there is a way to resize in PHP, that would be helpful.
Thanks
Mur
I cannot use teh onsubmit in html because I have to check the form to be sure that all of the required fields are filled, and this could take several submits. I am just looking for a PHP command to close the current window, and change the parent, and also, if there is a way to resize in PHP, that would be helpful.
Thanks
Mur
Is this how it should look?
Because that does not work in my script, nor does it work with separate echos.
Code: Select all
echo "<script language="JavaScript">
self.close();
</script>";-
Stewsburntmonkey
- Forum Commoner
- Posts: 44
- Joined: Wed Aug 24, 2005 2:09 pm
You need to escape the quotes around "JavaScript". 
Code: Select all
echo "<script language=\"JavaScript\">
self.close();
</script>";So shouldn't this work?
I thought that you could just use the setURL to tell it what page to open.
Code: Select all
echo "<script language=\"JavaScript\">
window.opener.setURL(\"www.google.com\");
self.close();
</script>";I also tried using window.opener.location.href which worked in firefox, but not safari, i found a site that said that noted this problem but did not give a solution, does anyone know how to do this.
Right now even closing the opener and opening a new window would be fine.
But window.opener.close(); did not work either
Right now even closing the opener and opening a new window would be fine.
But window.opener.close(); did not work either
- feyd
- Neighborhood Spidermoddy
- Posts: 31559
- Joined: Mon Mar 29, 2004 3:24 pm
- Location: Bothell, Washington, USA
http://www.codingforums.com/showthread.php?t=64828 has a possible solution.