hey every body i am using this code plus jquery with forms on my website and i jave two major problems. the first one is that i have three options at the top of my page and when the user picks an option a register form is displayed below it. however right know when i try and switch in between forms first form doesn’t close it just goes lower on the page. for example if i have option A and option B and i descide that i want option A but then midway through the process i change my mind and i want option B. when i go to click on option B, option a doesn’t close, and option B is displayed under it.
my second problem is that each form is self submitting. so whenever the user presses the register button the page reloads and evaluates the form. every time the user presses register i want the option that they picked to remain open. but right now every time the button is pressed they have to reselect the option they want
here is the code (don’t forget im using jquery)
```javascript
$(document).ready(function()
{
//put in p1's spot the id of the paragraph
$('table#groupreg').hide();
//replace group with the id of the anchor tag
$('a#group').click(function()
{
//put in p1's spot the id of the paragraph
$('table#groupreg').fadeIn('slow');
});
});
$(document).ready(function()
{
//put in p1's spot the id of the paragraph
$('table#soloreg').hide();
//replace group with the id of the anchor tag
$('a#solo').click(function()
{
//put in p1's spot the id of the paragraph
$('table#soloreg').fadeIn('slow');
});
});
$(document).ready(function()
{
//put in p1's spot the id of the paragraph
$('table#fanreg').hide();
//replace group with the id of the anchor tag
$('a#fan').click(function()
{
//put in p1's spot the id of the paragraph
$('table#fanreg').fadeIn('slow');
});
});
i realise that this is a little confusing but im really not that at javascript and i am not pretending to be. so it would be great if someone here could help me out a little
if you have any questions for me just ask
thanks in advance :)
ok well i was thinking of using sessions because im pretty sure there more secure. and i dont have the slightest clue aboput anything ajax. is it easy to do it or is it a complex? unless cookies are easier…
Sessions are managed from the server-side, and why is security of concern in this situation where you’re wanting the form type to be remembered?
It’s where you submit the form to a webpage, without reloading the page.
Even easier than cookies is to submit the form, and then redirect back to the multiple forms page with a fragment identifier, that determines which one is seen by default on loading the page.
For example:
page.php#groupreg
With which you can hide all the forms and then do:
$(location.hash).show();