faqts : Computers : Programming : Languages : JavaScript : Forms

+ Search
Add Entry AlertManage Folder Edit Entry Add page to http://del.icio.us/
Did You Find This Entry Useful?

4 of 42 people (10%) answered Yes
Recently 2 of 10 people (20%) answered Yes

Entry

How to create POST string on submit from an array of data?
Rewrite the submit-method to post a string not form elements?

Jul 12th, 2001 02:20
Jean-Bernard Valentaten, Andrew Horton,


Try using string-concatenation, e.g.
var inputArray = new Array('fill', 'it', 'up');
function arrayToString()
{
  var outputString = "";
  for(var i = 0; i <= inputArray.length; i++)
  {
    outputString += inputArray[i];
  }
  return outputString;
}
Should do the trick. Now you just have to rewrite the submit-method.
HTH