I didn't look through all your code, but I'm pretty sure you can get
what you're after just using the .serialize() method.
http://docs.jquery.com/Ajax/serialize

On Aug 28, 7:42 am, Boersnoes <[EMAIL PROTECTED]> wrote:
> Hi,
>
> I want to select all the values from the filled in/checked/selected
> fields in a form and concatenate them in a string so I can pass it on
> to the history plugin.
>
> I have written working code, but I feel that it could be simplified.
> Any suggestions?
>
>     var args = '';
>     $('.advancedSearchForm :input').each(
>         function(){
>             switch($(this).attr('type')){
>                 case("text"):
>                 case("select-one"):
>                     if($(this).val() != '' && $(this).attr("hidden" !=
> "true")){
>                         args += $(this).attr("name") + "=" + $
> (this).val()+";";
>                     };
>                     break;
>                 case("radio"):
>                     if($(this).attr('checked') && $(this).val() != '')
> {
>                         args += $(this).attr("name") + "=" + $
> (this).val()+";";
>                     };
>                     break;
>             }
>         }
>     );
>     return args;

Reply via email to