I have a added two new fields to my website, where users will have the ability to enter any character from a standard keyboard.
I will post my code so somebody could look at it,as it seems to be able to save every charc. but the + sign,don't know what is happening there
I am using sql 2000
Fields are DONATIONNUMBER and BLOODGROUP
function SaveDetails()
{
var szRedirect
if (window.thisForm.HospitalID.value == '' ||
window.thisForm.EnteredMonth.value == '' ||
window.thisForm.EnteredYear.value == '' ||
window.thisForm.ProductID.value == '' ||
window.thisForm.FateID.value == '' ||
window.thisForm.UnitsDiscarded.value == '' ||
window.thisForm.DonationNumbers.value == '' ||
window.thisForm.BloodGroup.value == '' ||
window.thisForm.CompiledBy.value == '' ||
window.thisForm.DateCompleted.value == '')
{
window.alert("You must enter all the fields in order to submit the data! Partial details cannot be stored!");
return
}
szRedirect = "HOSPITALID=" + escape(window.thisForm.HospitalID.value);
szRedirect = szRedirect + "&ENTEREDMONTH=" + escape(window.thisForm.EnteredMonth.options(window .thisForm.EnteredMonth.selectedIndex).text + ' ' +
window.thisForm.EnteredYear.options(window.thisFor m.EnteredYear.selectedIndex).text);
szRedirect = szRedirect + "&PRODUCTID=" + escape(window.thisForm.ProductID.value);
szRedirect = szRedirect + "&FATEID=" + escape(window.thisForm.FateID.value);
szRedirect = szRedirect + "&UNITSDISCARDED=" + window.thisForm.UnitsDiscarded.value;
szRedirect = szRedirect + "&COMPILEDBY=" + escape(window.thisForm.CompiledBy.value);
szRedirect = szRedirect + "&DATECOMPLETED=" + window.thisForm.DateCompleted.value;
szRedirect = szRedirect + "&DONATIONNUMBERS=" + escape(window.thisForm.DonationNumbers.value);
szRedirect = szRedirect + "&BLOODGROUP=" + escape(window.thisForm.BloodGroup.value)
window.navigate("Submit.asp?" + szRedirect);
}
------------------------------------------------------------
Call myCon.Execute ("INSERT INTO Bloodbank.dbo.Units (HospitalID, DateEntered, ProductID,FateID, UnitsDiscarded, DateCompleted, " & _
"CompiledBy, DonationNumbers,BloodGroup) VALUES ( " & _
BuildString(Request.queryString("HospitalID").item ) & "," & _
BuildString(Request.QueryString("EnteredMonth").it em) & ", " & _
BuildString(Request.QueryString("ProductID").item) & "," & _
BuildString(Request.queryString("FateID").item) & "," & _
Request.QueryString("UnitsDiscarded").item & ", GETDATE(), " & _
BuildString(unescape(Request.QueryString("Compiled By").item)) & "," & _
BuildString(unescape(Request.QueryString("Donation Numbers").item)) & "," & _
BuildString(unescape(Request.QueryString("BloodGro up").item)) & ")")
Call myCon.Close
What am I doing wrong, or not doing at all?
Thanks and regards