could you post code and/or a link?
Here's an excerpt - data picked from from combobox CTRY and javascript
function HDNCTRY saves the data into the hidden field. I put an ALERT
statement into it and it displayed the value "United States" (with
spaces). However in the destination form, I only get "United".
function hdnctry(cbobox) {
var col = (cbobox.options[cbobox.selectedIndex].text);
document.forms.additem.hiddenField.value = col;
}
<select name="ctry" onChange="hdnctry(this);">
<option value="">Choose a Country </option>
<option value="GBR">United States</option>
</select>
<input name="hiddenField" type="hidden" /></td>
Destination form:
<td width="181">Country</td>
<input name="ctry" type="text" id="ctry" value= <%
=Request("hiddenField") %> >
A fast look shows that you probably need to add quotation marks around
the above PHP block
<input name="ctry" type="text" id="ctry" value="<%
=Request("hiddenField") %>" >
lihao(XC)
You need quotes around your ASP statement:
I can't believe it was that simple!
Thank-you very much. Works fine now! :-)
It's _ASP_, unless the OP has enabled ASP-style tags in their php.ini.
>> <input name="ctry" type="text" id="ctry" value="<%
>> =Request("hiddenField") %>" >
>>
>> [...]
Please trim your quotes.
> I can't believe it was that simple!
>
> Thank-you very much. Works fine now! :-)
It is insufficient, though. You have to escape all double quotes in
Request("hiddenField") or you will end up with invalid HTML again.
In its simplest form, assuming that you are indeed using ASP:
<%@ LANGUAGE = "JScript" %>
<input name="ctry" id="ctry" value="<%
= Request("hiddenField").replace(/"/g, """)
%>">
BTW, validation would probably have revealed your previous problem, see
also http://diveintomark.org/archives/2003/05/05/why_we_wont_help_you
Also never post server-side code when you have a client-side problem,
unless someone who replies then asks you about it.
PointedEars
--
Use any version of Microsoft Frontpage to create your site.
(This won't prevent people from viewing your source, but no one
will want to steal it.)
-- from <http://www.vortex-webdesign.com/help/hidesource.htm>