PDA

View Full Version : Load external file - simple question



mtran
10-12-2009, 07:14 PM
I've just learned that we can load external file with javascript/ajax. I'm very new to this and have a very beginner's question.

If I have a from with 2 radio: US, and Global. Depending on what was selected, a longer sub-form will be loaded and displayed.
I used to do this with javascript toggling, but now exploring the option of using external loading. My question is, if say someone clicks "US," the US sub-form will be loaded and display, then that person fills out the form, but then at the end, he changes his mind and clicks "Global." My understanding is that the Global sub-form will be loaded, but how about the US sub-form, is it unloaded at the same time? How about the values of the fields that already filled out in the US sub-form, are they lingering somewhere, or they're completely gone?

Thanks!

jscheuer1
10-13-2009, 03:55 AM
I really don't know for sure. If these values were of inputs that have the same names as inputs on the other form - perhaps in some browsers. In such a situation it is best that the two forms have two unique and separate names, and that each input in each form have a name that differs from the inputs in the other form.

Then again, if your aim is to preserve some of the information, that can probably be worked out on the server side (assuming you have a server side language available to you on your host), but it might be a bit tricky. And at that rate it wouldn't be so much preserving the info, as fetching it again from the server side.