Click here to Skip to main content
15,889,116 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I want to create a form within another form
FOR EXAMPLE
if there is are 2 input radio buttons
cash and kindness
then if a user selects cash option then another data field should open asking how much he wants to donate in cash and if he selects kind then a list of checkboxes must open to select from
i donno how to do such a thing in forms since i am a new person to web

What I have tried:

<pre><div class="col-md-3">
      <div class="loc-widget form-widget">
                <h4>Want to help someone ??</h4>
        <h5 style="color:#fff;">Do you want to donate in cash or kind ??</h5>
                <ul>
                <li class="radio">
        <label  style="color:#fff;"><input type="radio" name="optradio">Cash</label>
                </li>
                <li class="radio">
        <label  style="color:#fff;"><input type="radio" name="optradio">Kind</label>
                </li>                               
                   <li>
                    <button type="submit">Submit</button>
                  </li>
                              
                </ul>
              </div>
            </div>

This is the form i have n i would like to know how to do what i desire
Posted
Updated 18-Apr-18 20:44pm

1 solution

No need for another form. you can use same form

create controls for taking cash value and other checkboxes for kindness. make them hide.

when user selects particular radio button then show the corresponding controls. use javascript or jquery for this.
 
Share this answer
 
Comments
Member 13778035 19-Apr-18 2:48am    
could you show me how to do that i am not sure upon how to work upon it ..it would be a great help for me ...
Member 13778035 19-Apr-18 2:50am    
or another example of code that has the similar kind of functionality

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