Forum Moderators: coopster
I could use some advice on building a form I need.
Task: I need to enter data for several accounts on a master page and have it posted onto the separate pages of each account.
What I have so far: I built a script that passes that data from the master window to the separate account pages
<FORM ACTION="http://www.mysite/CONTACT/clients/vendor.php">
List size
<INPUT TYPE="text" NAME="listsize"><br><br>
Alerts sent this month
<INPUT TYPE="text" NAME="alertssent">
<br><br>
<INPUT TYPE="submit">
</FORM>
This is the script on the master page. I have a separate script for each account page sending the info to each one.
The is the script I have on each account page to receive the data
<H2><center><font color="#330066">Number of customers on your alert list</H2>
<FORM NAME="formname">
<h3><center><font color="#FF0000"><INPUT TYPE="text" NAME="listsize"></></h3></center>
<H2><center><font color="#330066">Number of Alerts Sent</H2>
<h3><center><font color="#FF0000"><INPUT TYPE="text" NAME="alertssent"></></h3></center>
<br><br>
</FORM>
<SCRIPT LANGUAGE="JavaScript"><!--
function getParm(string,parm) {
// returns value of parm from string
var startPos = string.indexOf(parm + "=");
if (startPos > -1) {
startPos = startPos + parm.length + 1;
var endPos = string.indexOf("&",startPos);
if (endPos == -1)
endPos = string.length;
return unescape(string.substring(startPos,endPos));
}
return '';
}
var passed = location.search.substring(1);
document.formname.listsize.value = getParm(passed,'listsize');
document.formname.alertssent.value = getParm(passed,'alertssent');
//--></SCRIPT>
Problems that need solved:
The data goes though and is posted fine but it is not saved to the account page. When you call the page again the data is gone. How do I save the data I posted to the account pages? Same issue with the master page? I want to keep a running total that can be reset
Is there a better way to do this task?
Thanks in advance for your advice—Russell