indyng
asked on
How do I use Server.URLEncode on a string?
Hi Experts,
I have the following:
document.location.href= "AddLoad.asp?RecDate=" + x.RecDate.value + "&DeliveryNo=" + x.DeliveryNo.value + "&ShipmentNo=" + x.ShipmentNo.value + "&ManualNoteNo=" + x.ManualNoteNo.value + "&ReservationNo=" + x.ReservationNo.value + "&ShipFrom=" + x.ShipFrom.value + "&ShipTo=" + x.ShipTo.value + "&FromProv=" + x.FromProv.options[x.FromP rov.select edIndex].v alue +"&ToProv=" + x.ToProv.options[x.ToProv. selectedIn dex].value + "&PayorFreight=" + x.PayorFreight.options[x.P ayorFreigh t.selected Index].val ue + "&TransUsed=" + x.TransUsed.options[x.Tran sUsed.sele ctedIndex] .value + "&ContainerInitial=" + x.ContainerInitial.value + "&ContainerID=" + x.ContainerID.value +"&Notes=" + x.Notes.value + "&UpdateDetails=1&EditDeta ils=1"
x.PayorFreight.options[x.P ayorFreigh t.selected Index].val ue can contain an ampersand sometimes such as "A&B". How can this be handled?
Thanks
I have the following:
document.location.href= "AddLoad.asp?RecDate=" + x.RecDate.value + "&DeliveryNo=" + x.DeliveryNo.value + "&ShipmentNo=" + x.ShipmentNo.value + "&ManualNoteNo=" + x.ManualNoteNo.value + "&ReservationNo=" + x.ReservationNo.value + "&ShipFrom=" + x.ShipFrom.value + "&ShipTo=" + x.ShipTo.value + "&FromProv=" + x.FromProv.options[x.FromP
x.PayorFreight.options[x.P
Thanks
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Doh! factor avoidance: Make sure you only escape the values, not the URL &'s!