Forum Moderators: open

Message Too Old, No Replies

AJAX with forms

         

quozt

6:30 pm on Dec 13, 2005 (gmt 0)

10+ Year Member



hello, im using the dynamic drive code (Dynamic Ajax Content) to load pages depending on a link pressed, however the problem i am having is that though they are loaded they are not added to the source and my main reason for doing this would be for a form

i wanted to spit the form seperate forms

so you ahve a radio button and depending on what option you choose

one.html two.html three.html or four.html is added into the div that works fine however if those sub pages contain a form then the subpages input values are not submitted

(i really dont want to have all the information on the page and just use js and css to hide and display the infomation if possible)

if anyone has any advice please let me know

thanks

Dom

RonPK

9:06 pm on Dec 13, 2005 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Just to clarify things for dumb readers like me: what is the structure of the page? For example:

.. 
<form>
<!-- start of dynamically loaded content -->
<html><body>
<form>
<input type="text" name="foo">
</form>
</body></html>
<!-- end of dynamically loaded content -->
<input type="submit">
</form>
..

quozt

11:04 pm on Dec 13, 2005 (gmt 0)

10+ Year Member



<form>

<input>
<input>

<checkbox> <checkbox> <checkbox>

<-- dynamic content depending on checkbox ->>

<input> <input> <input>
<-- end of dynamic content -->

<input>
<input>

<submit>

quozt

11:05 pm on Dec 13, 2005 (gmt 0)

10+ Year Member



ok not quite sure how to edit my post but </form> at the end of that :)

a1call

11:42 pm on Dec 13, 2005 (gmt 0)

10+ Year Member



Hi quozt,

I believe that if you have the variable inputs in a <div> that is invisible, they will still submit. So why not just change the visibility depending on the check boxes that are selected using JavaScript?

quozt

11:50 pm on Dec 13, 2005 (gmt 0)

10+ Year Member



because im looking 6 forms with between 10 and 100 input box's each (its not as weird as it sounds when i set it out right) my main problem is if a person goes to the page and it has to download all the forms just to hide 5 of them and they only want to input into two box's its a waste of loading time for them and a waste of bandwidth for me

RonPK

5:35 pm on Dec 14, 2005 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



This is sort of a wild guess, but maybe you need to add the new fields to the document's existing DOM. With methods such as createElement() and appendChild().