www.webdeveloper.com
Results 1 to 5 of 5

Thread: Export web form without server side scripting

  1. #1
    Join Date
    Sep 2011
    Posts
    22

    Export web form without server side scripting

    Hello,

    I need a way to read the inputs of an html form and then stor thos somewhere without using php or perl. Can this be done with jquery and ajax?

    I saw this for storing the values in an array:

    Code:
    $('#myForm').submit(function() {     
    // get all the inputs into an array.     var $inputs = $('#myForm :input');      
    // not sure if you wanted this, but I thought I'd add it.     
    // get an associative array of just the values.    
    var values = {};     $inputs.each(function() {        
      values[this.name] = $(this).val();    
      }); 
    });
    Can I then take the values of that array and store them in a file? Ideally I could add a new line of values to that file each time the form is submitted.

  2. #2
    Join Date
    Sep 2011
    Posts
    22
    Sorry code should look like this:

    Code:
    $('#myForm').submit(function() {     
        // get all the inputs into an array.     
        var $inputs = $('#myForm :input');      
        // not sure if you wanted this, but I thought I'd add it.     
        // get an associative array of just the values.    
        var values = {};    
        $inputs.each(function() {        
          values[this.name] = $(this).val();    
        }); 
    });

  3. #3
    Join Date
    Sep 2011
    Location
    Memphis, TN
    Posts
    5
    what do you mean by not using server side scripting? you can grab the form data and then send it to the server using AJAX

  4. #4
    Join Date
    Sep 2011
    Posts
    22
    Im not sure I even kjnow what I mean. I just need to take the form data and send it to a file (maybe csv in a text file or something).

    I know there are php solutions and I have used them before, but in this case I can not run php on this server.

    Thank you.

  5. #5
    Join Date
    Oct 2010
    Location
    Versailles, France
    Posts
    1,264
    Use this script...

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

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



Recent Articles