It's me again.
I have a form in which after the inputs are validated they are then to be passed into a new page. I didn't like the look of the output, ie;
name = John
address = 1234 Some St.
I would like some alignment;
name = John
address = 1234 Some St.
The original function was this;
I tried to modify it so that the output is written in a table. (see below)
Being a newbie in javascripting I'm lost.
Can anybody help?????????
Thanks in advance
I have a form in which after the inputs are validated they are then to be passed into a new page. I didn't like the look of the output, ie;
name = John
address = 1234 Some St.
I would like some alignment;
name = John
address = 1234 Some St.
The original function was this;
Code:
function parseSearchString()
{
var pairs=unescape(location.search.substring(1).replace(/\+/g," ")).split('&');
for (var i=0;i<pairs.length;i++){
var pair = pairs[i].split('=');
this[pair[0]]=pair[1];
}
}
var search = new parseSearchString();
//this will output all the passed variables
document.write("These are the variables passed:<br />");
for (o in search) document.write(o + " = " + search[o]+"<br />");
I tried to modify it so that the output is written in a table. (see below)
Being a newbie in javascripting I'm lost.
Can anybody help?????????
Thanks in advance
Code:
<html><head>
<title></title>
<script type="text/javascript">
//<![CDATA[
function parseSearchString()
{
var pairs=unescape(location.search.substring(1).replace(/\+/g," ")).split('&');
for (var i=0;i<pairs.length;i++){
var pair = pairs[i].split('=');
this[pair[0]]=pair[1];
}
}
var search = new parseSearchString();
document.write("These are the variables passed:<br />");
document.write ("<table width='260' border='1'>")
for (o in search) document.write("<tr><td align='right'>" + o + "=" + "</td>"
document.write ("<td align='left'>" + search[o]+ "</td></tr>"); }
document.write ("</table>");
//]]>
</script>
</head><body></body></html>