struts-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "aum strut" <>
Subject Validating Autocompleter using javascript
Date Tue, 09 Dec 2008 18:37:00 GMT
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="" forceValidOption="true" theme="simple"
id="" cssClass="inputText" cssStyle="width:125px" list="{'Andaman
and Nicobar','Andhra Pradesh','Arunachal Pradesh','Assam'}"/>

and the code to validate this is:

document.getElementById('').value = document.getElementById(

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




following is the error Mozilla is showing to me

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

*Any suggestion for this are welcomed

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

thanks in advance,


  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message