0

I have a need to force all items in a listbox to become selected before I force a submit.

I need something to select everything in a listbox called SpacesServed:

$("#form1").submit( function() { . . . code goes here . . . } );

Any ideas?

2
Contributors
2
Replies
4
Views
9 Years
Discussion Span
Last Post by jeffasbrand
0

is this what you are looking for?

<script type="javascript" >
//replace formname with with the name of your form and inputname with the 
//name of the input field you want to select
document.formname.inputname.focus(); 
  document.formname.inputname.select(); 
</script>
0

Actually, no.

The code I ended up needing/using was more like this:

$("#Formname").submit( function() {
        $('#listbox2').attr('selected','true');
    }); 

Thanks though.

Edited by mike_2000_17: Fixed formatting

This question has already been answered. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.