strip_tags on select options

strip_tags on select options

peterbrownepeterbrowne Posts: 215Questions: 35Answers: 0

I have a select in the editor where the options in the select contain HTML tags. I want to remove those tags for the select and retain them for the records in the database. Is there a way to do this in the editor, such as using PHP strip_tags?

    label: "Program Outcomes:",
    name: "program_outcome[].program_outcome_pk",
    type: "select",
    placeholder: 'No selection',
    placeholderDisabled: false,
    placeholderValue: 0,
    multiple: true

This question has an accepted answers - jump to answer


  • rf1234rf1234 Posts: 1,828Questions: 55Answers: 271
    Answer ✓

    And for the rest of the work you already have an answer from me, I guess. The event to use is "xhr"

  • peterbrownepeterbrowne Posts: 215Questions: 35Answers: 0

    Thanks, I used your server side option:

            Mjoin::inst( 'program_outcome' )
                ->link( 'unit_outcome.unit_outcome_pk', 'program_outcome_unit_outcome_lookup.unit_outcome_fk' )
                ->link( 'program_outcome.program_outcome_pk', 'program_outcome_unit_outcome_lookup.program_outcome_fk' )
                ->order( 'program_outcome.program_outcome asc' )
                    Field::inst( 'program_outcome_pk' )
                        ->options( Options::inst()
                            ->table( 'program_outcome' )
                            ->value( 'program_outcome_pk' )
                            ->label( 'program_outcome' )
                            ->render( function ( $row ) {
                return strip_tags($row['program_outcome']);
            } )
                    Field::inst( 'program_outcome' )
Sign In or Register to comment.