Results 1 to 3 of 3

Thread: traversing form elements

  1. #1

    traversing form elements

    help with doing this on javascript please.

    i have a form where there are many rows. each row has 15 columns. i would only like the values of the columns from 9 to 12. on these columns, a checkbox is there where a user can un/check it. checked being 1 and unchecked 0.

    how do i go about this?

    by the way i have to traverse the elements of checkboxes on all columns first and see if it is checked or not before i submit.. .

  2. #2
    redhead's Avatar
    Join Date
    Jun 2001
    Copenhagen, Denmark
    What do you mean ? Do you want something which on the fly traverses itself ?
    Where your part of the checkform, as it is beeing filled with check a seperate similar area, where the traverse pattern will emerge ?
    Something like:
    Orriginal form:
    Traverse form:
    Or is it something completely different ? Where, once you press submit the form itself will emerge traversed ?

    Or are you looking for something like this:
    Then you can follow this thread and if you're currious on how the data is beeing parsed on, you can check this thread
    Don't worry Ma'am. We're university students, - We know what We're doing.
    'Ruiat coelum, fiat voluntas tua.'
    Datalogi - en livsstil; Intet liv, ingen stil.

  3. #3
    yeah something like that. but it will only traverse after submit was clicked.

    i got it to work like this.

        var the_form = document.getElementById("form1");
        var str = "";
        for ( var x=0; x<the_form.length; x++ ) {
        	temp = the_form.elements[x].name
    so the output is many zeroes and ones. the names of the checkboxes depends on which column it belongs to. so if its at column 8 then it is named col8. that's why at first i was having a difficult time coz i was used to calling elements by unique names or IDs and this was something new to me.

    i learned a different trick some time ago about putting '[ and '] after an element name so i could just easily get the values using a loop. couldn't apply it in this case though.

    would it be a good idea to pass this with a POST method or GET? what do you advise? now that one problem is solved, another comes up. LOLz

    i'll read those links in a while.. .

Similar Threads

  1. sorry form
    By vaibhav dadhich in forum Linux - General Topics
    Replies: 1
    Last Post: 01-13-2007, 06:59 PM
  2. Looking for a secure form mail script
    By starfish in forum Programming
    Replies: 1
    Last Post: 10-23-2006, 04:19 AM
  3. Sending Form Results
    By imported_mikel in forum Windows - General Topics
    Replies: 0
    Last Post: 10-19-2006, 05:15 PM
  4. Adding an 2nd mobile field in the contact form
    By emmyisblue in forum Windows - General Topics
    Replies: 1
    Last Post: 06-18-2006, 10:33 PM
  5. Using Sendmail to send a user input form
    By Rastar in forum Linux - General Topics
    Replies: 2
    Last Post: 07-07-2004, 07:54 AM


Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts