Click here to Skip to main content
15,896,154 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
form code

HTML
<form>

 <select name="select">
<option value="empty">none</option>
    <option value="fiction">fiction</option>
<option value="journals">journals</option>
<option value="acadamic">acadamic</option>
</select>



            <form action="result.php" method="POST">
 
           <input type="text" value=" " name="q" size="10" id="searchfield" title="searchfield" onFocus="clearText(this)" onBlur="clearText(this)" />
                    <input type="submit" name="Search" value="" alt="Search" id="searchbutton" title="Search" />

</form>
            </form>

Problem is when ever I try to submit a button action is not calling to
result.php
Posted
Updated 11-Feb-15 3:29am
v2
Comments
Kornfeld Eliyahu Peter 11-Feb-15 9:34am    
Are you sure the code you posted is correct? Do you really have a form inside a form?
Member 11406049 11-Feb-15 9:40am    
I am beginner to php I don't know how to use.. I am sorry and yes the code I posted is correct
Member 11406049 11-Feb-15 9:46am    
thank you very much bro.. its working I wrote all code in form... I have tones of doubts on php will help me in future? please give me you mail id if you are interested

1 solution

It is forbidden and unsupported to nest form tags (you can have multiple form tags but not nested), so in your case the browser dismissed the second (inner) form tag and for that no action took place...
Remove the first (outer) form tag to make your code work...
(And of course it has nothing to do with PHP - it is HTML related)
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900