Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations bkrike on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

htmlEditFormat and form submission 1

Status
Not open for further replies.

jimmyshoes

Programmer
Jun 1, 2008
132
GB
The urls I am working with look like this

Code:
page.cfm?somevar=1&anothervar=2

Code:
<form name="someForm" action="#urlStr#" method="post">


This works fine. I get the form variables and the url variables

However if I use htmlEditFormat as follows
Code:
<form name="someForm" action="#htmlEditFormat(urlStr)#" method="post">

then anothervar comes through as amp;anothervar=2

Why is this? Should I stop using htmlEditFormat(...), or is it bad practice to add variables to the action url when submitting a form
 
Why is this?

It is because of the "&". Ampersands are the delimiter for url variables. They indicate where each key/value pair ends and another begins:

page.cfm?key1=value1&key2=value2&key3=value3

or is it bad practice to add variables to the action url when submitting a form

No it is perfectly fine. You just have the wrong function. URL variables should be encoded with URLEncodedFormat.

----------------------------------
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top