vinpkl
February 9, 2012, 6:05am
1
hi all
i have <form> inside <form>
the parent form submit button doesnt works. But nested form submit buton works.
I want both submit buttons to work as both does different tasks.
what am i doing wrong ?
<?
if(isset($_REQUEST['submit']))
{
echo "submit Parent"; /*This message doesnt echo */
}
if(isset($_REQUEST['av_submit']))
{
echo "submit Nested"; /* This message is echo fine */
}
?>
<?
echo "<form id='form1' name='form1' method='post' action='$qrystring'>";
// for 2nd starts which is inside a loop
echo "<form name='avform' id='avform' method='post' action='$qrystring2'>";
echo "<input name='amt[]' type='checkbox' value='child' id='child' />child <br>";
echo "<input type='submit' value='submit Nested' name='av_submit'/>";
echo "</form>";
// form 2nd ends
echo "<td><input name='submit' type='submit' value='submit Parent'/></td>";
echo "</form>";
?>
vineet
Ummm nested forms don’t work at all. You need to rethink how you are setting this form up.
vinpkl
February 9, 2012, 8:58am
3
hi
i tried putting the form inside <iframe>
but now how will i use the variables values that were being used in parent page.
I m not getting values of those variables to work inside <iframe>
vineet
Don’t use an iframe (I’m not sure why you are), restructure your form as per logic_earth’s suggestion.
vinpkl
February 9, 2012, 9:07am
5
If i use ajax popup and insert this form inside that pop up
then will i be able to use those variables from parent page inside my pop ?
or ajax pop will also work same as iframe ?
vineet
Just “pop up” the form, which already exists in the DOM. Again, I’m not why you need an iframe here.
Lets get this thread moved the JS forum for now, you can get your form/pop-up/iframe stuff working there then come back and we’ll help with the nard stuff.
Anthony.
vinpkl
February 9, 2012, 9:17am
7
i want to use PHP variables values that are in parent page
how will javascript people help me about PHP variables
correct me if i m wrong
vineet
vinpkl
February 9, 2012, 9:23am
8
If we forget about the <from> part
I know how to create popup or iframe
but can anyone tell me in general how to use PHP variables values from parent page inside the <iframe> or “Popup” box
vineet
Popup box is just on teh same page, so you just use the variables as normal - output them in the right place!