How to pass dynamically generated data from JS to server.


DevX Home    Today's Headlines   Articles Archive   Tip Bank   Forums   

Results 1 to 3 of 3

Thread: How to pass dynamically generated data from JS to server.

  1. #1
    Join Date
    Mar 2009
    Posts
    3

    How to pass dynamically generated data from JS to server.

    Hi, I'm just wondering how to pass data from javascript to server.

    There is just only one way which came upon.
    That's something like hidden div in <form> .. </form>, get the object, and via InnertHTMLconcatenate <input>s ...

    document.getElementById("mydiv").InnertHTML = "<input type=\"hidden\" value=\""+data+"\" />";
    concatenate
    And so on ...

    I don't like it really. And also there is a bug when data contains " it goes wrong

    So how this is done professionally?

  2. #2
    Join Date
    Apr 2007
    Location
    Sterling Heights, Michigan
    Posts
    8,666
    I don't answer coding questions via PM or Email. Please post a thread in the appropriate forum section.
    Please use [Code]your code goes in here[/Code] tags when posting code.
    Before posting your question, did you look here?
    Got a question on Linux? Visit our Linux sister site.
    Modifications Required For VB6 Apps To Work On Vista

  3. #3
    Join Date
    Mar 2007
    Location
    Bangalore, India
    Posts
    247
    Look up Ajax or XMLHttpRequest. Hidden form elements is a safer way of doing what you tried to do. You can submit the form via JavaScript.

Similar Threads

  1. find version & service packs
    By rperez in forum Database
    Replies: 5
    Last Post: 01-02-2009, 05:14 PM
  2. Importing .NET data Grid to the SQL server database
    By software_develo in forum Database
    Replies: 2
    Last Post: 11-21-2005, 11:18 AM
  3. Accessing MySQL data from MS SQL Server 2000
    By Andy H in forum Database
    Replies: 8
    Last Post: 10-04-2005, 02:27 AM
  4. Replies: 0
    Last Post: 08-16-2005, 11:48 AM
  5. Remove exchange from a site
    By andriano in forum Enterprise
    Replies: 1
    Last Post: 10-02-2000, 04:54 PM

Tags for this Thread

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
 
 
FAQ
Latest Articles
Java
.NET
XML
Database
Enterprise
Questions? Contact us.
C++
Web Development
Wireless
Latest Tips
Open Source


   Development Centers

   -- Android Development Center
   -- Cloud Development Project Center
   -- HTML5 Development Center
   -- Windows Mobile Development Center