not sure why this isn't working, whats the flaw in my logic?
I'm hoping when the user click the link to initiate the LastSaving function that a form will be created with the appropiate values as hidden and submits to another page for db table updating. Thanks
<a href="javascript:ListSaving();">Save This List</a>
I'm hoping when the user click the link to initiate the LastSaving function that a form will be created with the appropiate values as hidden and submits to another page for db table updating. Thanks
<a href="javascript:ListSaving();">Save This List</a>
Code:
<script>
function ListSaving() {
document.write "<form name='f1' action='recruitmentListSave.asp' method='post'>";
document.write "<input type='hidden' name='ID' value=''>";
document.write "<input type='hidden' name='LastName' value=''>";
document.write "<input type='hidden' name='FirstName' value=''>";
document.write "<input type='hidden' name='Email' value=''>";
document.write "<input type='hidden' name='Fax' value=''>";
document.write "<input type='hidden' name='Province' value=''>";
document.write "<input type='hidden' name='RegistrationURL' value=''>";
document.write "<input type='hidden' name='UnsubscribeURL' value=''>";
document.write "<input type='hidden' name='AccessCode' value=''>";
document.write "<input type='hidden' name='Specialty' value=''>";
document.write "<input type='hidden' name='Profession' value=''>";
document.write "<input type='hidden' name='SurveyName' value=''>";
document.write "<input type='hidden' name='SurveyID' value=''>";
document.write "<input type='hidden' name='creator' value=''>";
document.write "<input type='hidden' name='modifier' value=''>";
document.write "</form>";
document.forms["f1"].elements["ID"].value = 'v1';
document.forms["f1"].elements["LastName"].value = 'v2';
document.forms["f1"].elements["FirstName"].value = 'v3';
document.forms["f1"].elements["LastName"].value = 'v4';
document.forms["f1"].elements["Email"].value = 'v5';
document.forms["f1"].elements["Fax"].value = 'v6';
document.forms["f1"].elements["Province"].value = 'v7';
document.forms["f1"].elements["RegistrationURL"].value = 'v8';
document.forms["f1"].elements["UnsubscribeURL"].value = 'v9';
document.forms["f1"].elements["AccessCode"].value = 'v10';
document.forms["f1"].elements["Specialty"].value = 'v11';
document.forms["f1"].elements["Profession"].value = 'v12';
document.forms["f1"].elements["SurveyName"].value = '<% = gstrSessionSurveyName %>';
document.forms["f1"].elements["SurveyID"].value = '<% = gstrSessionSurveyID %>';
document.forms["f1"].elements["creator"].value = '<%Session("uzor")%>';
document.forms["f1"].elements["modifier"].value = '<%Session("uzor")%>';
alert("List Saved!");
document.f1.submit();
}
</script>