struts-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Sreekanth S. Nair" <sreekanth.n...@egovernments.org>
Subject Re: String list
Date Fri, 27 Jul 2012 06:06:19 GMT
Hi' Adriana
Check out this link and do it
http://www.dzone.com/tutorials/java/struts/struts-example/struts-html-select-tag-example-1.html


-- 
Thanks & Regards
Nick


On Fri, Jul 27, 2012 at 7:41 AM, Adriana G <adrianaleal14@gmail.com> wrote:

> First: Im working with ajax and struts 1.
>
> I want to refresh a select option without refreshing the whole .jsp.
>
> The options of that select  is an string list and i want to put in a select
> option, but it doesn't work :S.
> if a i put the result (list) in a div, it shows me the list, but in the
> select opcion doesn't.
> what's wrong?
>
> <html:select styleClass="select" styleId="ciudad"
> property="ciudad.idCiudad" name="mineriaForm"
> onclick="doAjaxPost('Ciudades')" >
> <html-el:option value="Seleccione la ciudad"></html-el:option>
> <logic:iterate id="ciu" name="mineriaForm" property="lista">
> <html-el:option value="${ciu.idCiudad}">
> <c:out value="${ciu.nombre}"></c:out>
>  </html-el:option>
> </logic:iterate>
> </html:select>
>
>
> _____
>
>
>
>  <script type="text/javascript">
>
> function doAjaxPost(tipo) {
> // get the form values
> var name = $('#name').val();
> $.ajax({
> type: "POST",
> url: "/fethusweb/mineria.do",
> data: "name=" + name +"&var="+tipo,
> success:
> function(response){
> $('#prueba2').html(response);
>           },
>                error: function(e){
>                      alert('Error: ' + e);
>                  }
>              });
>           }
>
>         </script>
>
>
>
> Thanks.
>
>
> --
> Adriii :)..
>

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