Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <select name="array[]" id="array" multiple>
- <option value="Val1" <?php if( @in_array( 'Val1', @$_POST['array'] ) ) { echo 'selected="selected"'; } ?>>Val1</option>
- <option value="Val2" <?php if( @in_array( 'Val2', @$_POST['array'] ) ) { echo 'selected="selected"'; } ?>>Val2</option>
- </select>
- <script type="text/javascript">
- var arr = new LiveValidation('array', { validMessage: ' ', wait: 500});
- arr.add( Validate.Presence, { failureMessage: ' ' } );
- arr.add( Validate.Exclusion, { within: [ "" ], failureMessage: ' ' } );
- </script>
- <option value="Val1" <?php if( @in_array( 'Val1', @$_POST['array'] ) ) { echo 'selected="selected"'; } ?>>Val1</option>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement