Hi Bob,
Even so, the request that your making to your 'ajax servlet', the url depends on the value of the
first select box. Somthing like 'myajaxservlet?firstvalue=Australia'
are you building this url in javascript before making the request? thats the point at which you want
to encode it. If you are doing it this way, the servlet will be unable to handle the request as you
expected because it will take "United States" and "US Vargin Islands" as separate parameters rather
than a single one. Why? because '&' is used as the delimeter. If you use the javascript escape
function e.g javascript:escape('United States & US Vargin Islands'), your servlet will handle this
as a single parameter.
It doen't matter that your not using struts, ajax is independant of your servlet side code, it could
be written in asp if you are that way inclined ;-)
Gareth
[EMAIL PROTECTED] wrote:
Actually no. I am modifying legacy jsp/servlet code and not using Struts.
What happens is, when the users selects a state from the dropdown, I make an
ajax call to my servlet that returns a list of values to be populated in the
dropdown. Does this help?
Gareth Evans <[EMAIL PROTECTED]> wrote:I take it your adding the value of your drop down to part of the query string that makes the
xmlhttprequest, something along the lines of:
'myajaxpage.do?value=' + document.myForm.myDropdown.value;
try using the javascript escape function:
'myajaxpage.do?value=' + escape( document.myForm.myDropdown.value );
regards,
Gareth
[EMAIL PROTECTED] wrote:
Hi guys,
I know that this is not the AJAX list but I know people like Frank Z. et all
worked on it before. I am seeing problem with populating a dropdown using ajax
when the data contains ampersand.
For example:
My collection works when I have two values for the country field: 'United
States', 'Australia'
But, it doesn't work when I have values like: 'United States & US Vargin
Islands', 'Australia'
Can somebody please help.
Thanks,
Bob
__________________________________________________
Do You Yahoo!?
Tired of spam? Yahoo! Mail has the best spam protection around
http://mail.yahoo.com
--
Gareth Evans
MSoft eSolutions Limited
Technology Centre
Inward Way
Rossmore Business Park
Ellesmere Port
Cheshire
CH65 3EN
--
Tel: +44 (0)870 0100 704
Fax: +44 (0)870 9010 705
E-Mail: [EMAIL PROTECTED]
Web: www.msoft.co.uk
----------------------------------------------
Terms:
Please note that any prices quoted within this e-mail are subject to VAT.
All program details and code described in this e-mail are subject to
copyright © of MSoft eSolutions Limited and remain the intellectual
property of MSoft eSolutions Limited.
Any proposal or pricing information contained within this e-mail are
subject to MSoft eSolutions' Terms and Conditions
----------------------------------------------
Disclaimer:
This message is intended only for use of the addressee. If this message
was sent to you in error, please notify the sender and delete this
message. MSoft eSolutions Limited cannot accept responsibility for viruses,
so please scan attachments. Views expressed in this message do not
necessarily reflect those of MSoft eSolutions Limited who will not
necessarily be bound by its contents.
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]