<form>insde <form>

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
Lphp
Forum Commoner
Posts: 74
Joined: Sun Jun 26, 2011 9:56 pm

<form>insde <form>

Post by Lphp »

:( submit form , is that possible to handle

Code: Select all

<form id ="outside" action="post"method="outsideup">
<p> hello
<form id ="inside" action="post" method="inside up"></form>

</form>//outside form
User avatar
social_experiment
DevNet Master
Posts: 2793
Joined: Sun Feb 15, 2009 11:08 am
Location: .za

Re: <form>insde <form>

Post by social_experiment »

You could create the syntax but i don't think it will work because which ever form is submitted will be submitted to it's respective action and leave the other form un-submitted. Which scenario would require such a set-up?
“Don’t worry if it doesn’t work right. If everything did, you’d be out of a job.” - Mosher’s Law of Software Engineering
User avatar
AbraCadaver
DevNet Master
Posts: 2572
Joined: Mon Feb 24, 2003 10:12 am
Location: The Republic of Texas
Contact:

Re: <form>insde <form>

Post by AbraCadaver »

It is not possible, you can not have a form inside a form. Use two separate forms and/or explain what you are trying to accomplish.
mysql_function(): WARNING: This extension is deprecated as of PHP 5.5.0, and will be removed in the future. Instead, the MySQLi or PDO_MySQLextension should be used. See also MySQL: choosing an API guide and related FAQ for more information.
User avatar
social_experiment
DevNet Master
Posts: 2793
Joined: Sun Feb 15, 2009 11:08 am
Location: .za

Re: <form>insde <form>

Post by social_experiment »

Code: Select all

<form action="page.php" method="post" />
    <form action="page1.php" method="post" />
        <input type="submit" value="foo" name="bar" />
    </form>
    <input type="submit" value="foo2" name="bar2" />
</form>
AbraCadaver is correct, it won't work. The curious thing is that in an example like this, the inner submit button doesn't submit to the page of the inner form action (page1.php) but to the outer form action (page.php). It looks like the second form tags are completely ignored and the second submit button becomes useless.
“Don’t worry if it doesn’t work right. If everything did, you’d be out of a job.” - Mosher’s Law of Software Engineering
Zephni
Forum Newbie
Posts: 8
Joined: Fri Oct 07, 2011 1:59 pm

Re: <form>insde <form>

Post by Zephni »

@social_experiment that's interesting, Iv'e never tested that out, but then again.. I'm curious to why Lphp wanted to use a form inside a form?
User avatar
social_experiment
DevNet Master
Posts: 2793
Joined: Sun Feb 15, 2009 11:08 am
Location: .za

Re: <form>insde <form>

Post by social_experiment »

Zephni wrote:I'm curious to why Lphp wanted to use a form inside a form?
Ditto. Offhand i cannot think of any situation that would require such a configuration. If a second form is required it would be more logical to have a second, seperate form.
“Don’t worry if it doesn’t work right. If everything did, you’d be out of a job.” - Mosher’s Law of Software Engineering
Lphp
Forum Commoner
Posts: 74
Joined: Sun Jun 26, 2011 9:56 pm

Re: <form>insde <form>

Post by Lphp »

one submit form , let a student information, then one field is phone , allow 3 phone , if I put the phone on other tables not the student , when you reach the update part , that is how to question pop up!
User avatar
social_experiment
DevNet Master
Posts: 2793
Joined: Sun Feb 15, 2009 11:08 am
Location: .za

Re: <form>insde <form>

Post by social_experiment »

Lphp wrote: let a student information, then one field is phone , allow 3 phone ,
I still don't quite understand but forms can accept many input fields, the issue is maybe the logic with which you are designing the form :)
“Don’t worry if it doesn’t work right. If everything did, you’d be out of a job.” - Mosher’s Law of Software Engineering
Post Reply