Hi all,

i am struck in a simple problem but not able to proceed as i m unable to
find any solution for this. I am using struts2 UI tags and in order to
validate the user input i am using javascript for validation(Currently not
in a position to use validation frame work).

everything was going ok but now i have to use auocompleter and here
javascript validation is not working.i have created a seperated javascript
file and validating the user input using this file.

My javascript validation is working fine(even displaying errors) up to the
point it encounters autocompleter but it stops validating the input fields
after it.

below is the code i m using to validtate autocompleter:


<s:autocompleter name="addressPO.city" forceValidOption="true" theme="simple"
id="addressPO.city" cssClass="inputText" cssStyle="width:125px" list="{'Andaman
and Nicobar','Andhra Pradesh','Arunachal Pradesh','Assam'}"/>



and the code to validate this is:

document.getElementById('addressPO.city').value = document.getElementById(
'addressPO.city').value.trim();

if(document.getElementById('addressPO.city').value == null ||
document.getElementById('addressPO.city').value == "" )

{

alert("error");

}

following is the error Mozilla is showing to me

*Error: document.getElementById("addressPO.city") has no properties*

*
*Any suggestion for this are welcomed

Pleaes suggest me where i am doing wrong in order to validate this
autocomplete.

thanks in advance,

umesh

Reply via email to