Hi Admin..!!

i want source code in php+ajax for a form, in such a way that, suppose i have a form in php, with 10 different fields, when the user fills that form, the fields next to gender should automaically change, like the remaining fields must be different for Male and Female.
As soon as the user selects his/her gender, the form fields must change....
Please help me out in getting code for this....

Recommended Answers

All 3 Replies

I don't think that anyone will code that for you. The forum is for help and discussion, not for us to code for you.

If you want help you'll get it, but if you want somebody to do the job for you, you won't.

Give it a try first, post your code, ask for specific help on an item that you cant figure out.

As the above two said, we're not here to write your code for you from scratch. However assuming you can code, here's a concept to point you in the right direction:
1. Two radio buttons for gender, one with ID male, the other with ID female.
2. Two separate DIVs or FIELDSETs. First has the fields for if MALE is selected, second has the fields for if FEMALE is selected. Both start off hidden.
3. Using JavaScript, detect when one of the buttons is clicked. If MALE is clicked, hide the FEMALE DIV, show the MALE DIV. If FEMALE is clicked, hide the MALE DIV, show the FEMALE DIV.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.