score:-1
Accepted answer
defaultvalue
takes the value of the default option you want selected. your option select a type has no value.
if you do <option value="-1">select a type</option>
then defaultvalue={-1}
it should work.
<select defaultvalue={-1} onchange={ this.handletypeselect.bind(this, event)}>
<option value="-1" disabled>select a type</option>
<option value="type1">type1</option>
<option value="type2">type2</option>
</select>
Source: stackoverflow.com
Related Query
- ReactJs Select add default value
- uncontrolled <select> default value in ReactJS
- Reactjs select value opition value map iteration with default value
- How to set default value in material-UI select box in react?
- React | Ant design select default value
- Setting a default value on a react select dropdown that is populated from an API call
- A component is changing the default value state of an uncontrolled Slider after being initialized. Material UI Slider with Redux State
- ReactJS + Material-UI: How to set current date as default value using Material-UI's <DatePicker>?
- how to set default value in select using react js
- ReactJS: Select with default value from props without onChange event?
- Set select default value doesn't work
- How do I set a default value for a select menu in my React form component?
- How to give default value and placeholder to redux form select field?
- ReactJS - Clear select value on focus
- Showing a default value for a select control using react and material-ui control
- react select not recognizing default value
- show default value in select input with backgroundcoulr different for each : react js
- A component is changing the uncontrolled value state of Select to be controlled
- ReactJS Value of previous input is set by default in new input
- How to reset value of select box to default in react
- How to make a select input that is dependent on other inputs to always show a default value in React?
- React - How do I display the first value of an array as the default value in a select form?
- select method to restore to default value
- Insert value of a select with axios in reactjs
- React set default value for select
- set default value for select in react js
- Current value not reflecting in reactjs select component
- Set default value for select if `select` is inserted
- How can I send a value with Select tag through the useState on ReactJS
- Select Dropdown, make default Value not a selectable option
More Query from same tag
- How to upload a file from React front end to FastAPI?
- TypeError: util.promisify is not a function?
- To-Do-List Add-new-item button doesn't add anything
- How to add API Gateway SDK to React?
- How do I keep react from stripping a-frame attributes?
- How to change the font color of Material UI table with makeStyles?
- React - How to implement isLogin() function?
- How to Render Fetched Object Items in React Component
- Reroute user if conditions are met
- React component onClick handler not working
- Correct syntax for props in SVG in jsx
- TypeScript + React: Enforce that component returns another type of component
- Why is my type null in React and TypeScript?
- React: How to use render props to implement Role Based Authentication
- How to use google translation api with react
- I want to fetch serviceData id like 3 data the id in the url and i want only the one record where id is 3
- Undefined getting value from fetch request in a JSON file using REACT.JS
- Using Lambda/API Gateway in ReactJS
- DefaultMessage with singular and plural in react typescript
- React state property undefined in function component using Context API
- Code coverage on JSX files with Istanbul + Webpack
- Seem like it ignore update mutation in apollo graphql?
- String useState Value Is Empty after Storing a Value in an API Response to It
- Parent page doesn't scroll when mouse over iframe
- How to get button value when event is propagated
- React Redux Router pass props
- react-virtuoso: overscan props does not work
- How can I show my backend api errors via the UI with axios React?
- Passing props in React Route component for "react-router-dom": "^5.2.0"
- How can I find last child in array list like tree