![Oracle Drags Its Feet in the JavaScript Trademark Dispute](https://cdn.sanity.io/images/cgdhsj6q/production/919c3b22c24f93884c548d60cbb338e819ff2435-1024x1024.webp?w=400&fit=max&auto=format)
Security News
Oracle Drags Its Feet in the JavaScript Trademark Dispute
Oracle seeks to dismiss fraud claims in the JavaScript trademark dispute, delaying the case and avoiding questions about its right to the name.
@cloudflare/component-form
Advanced tools
Cloudflare Form Component
Installation with yarn is recommended
$ yarn add @cloudflare/component-form
import React from 'react';
import {
Form,
FormHeader,
FormFooter,
FormFieldset,
FormLabel,
FormFieldError
} from '../../src';
import { Input } from '@cloudflare/component-input';
import { Select } from '@cloudflare/component-select';
import { Textarea } from '@cloudflare/component-textarea';
import { Button } from '@cloudflare/component-button';
class FormComponent extends React.Component {
constructor(props) {
super(props);
this.state = {
firstName: '',
lastName: '',
type: 'suggestion',
message: 'This is blasphemy! This is madness!'
};
this.handleFirstNameChange = this.handleFirstNameChange.bind(this);
this.handleLastNameChange = this.handleLastNameChange.bind(this);
this.handleTypeChange = this.handleTypeChange.bind(this);
this.handleMessageChange = this.handleMessageChange.bind(this);
this.handleSubmit = this.handleSubmit.bind(this);
}
handleFirstNameChange(e) {
this.setState({ firstName: e.value });
}
handleLastNameChange(e) {
this.setState({ lastName: e.value });
}
handleTypeChange(type) {
this.setState({ type });
}
handleMessageChange(e) {
this.setState({ message: e.value });
}
handleSubmit() {
console.log(JSON.stringify(this.state, null, 2));
this.setState({
firstName: '',
lastName: '',
type: 'suggestion',
message: ''
});
}
render() {
return (
<Form layout="horizontal" onSubmit={this.handleSubmit}>
<FormHeader title="Feedback Form" />
<FormFieldset legend="Name">
<FormLabel htmlFor="firstName">First Name</FormLabel>
<Input
id="firstName"
name="firstName"
type="text"
value={this.state.firstName}
onChange={this.handleFirstNameChange}
/>
<FormLabel htmlFor="lastName">Last Name</FormLabel>
<Input
id="lastName"
name="lastName"
type="text"
value={this.state.lastName}
onChange={this.handleLastNameChange}
/>
</FormFieldset>
<FormFieldset legend="Type">
<FormLabel htmlfor="type" hidden>
Type
</FormLabel>
<Select
id="type"
options={[
{ value: 'suggestion', label: 'Suggestion' },
{ value: 'problem', label: 'Problem' }
]}
value={this.state.type}
onChange={this.handleTypeChange}
/>
</FormFieldset>
<FormFieldset legend="Message">
<FormLabel htmlFor="message" hidden>
Message
</FormLabel>
<Textarea
id="message"
name="message"
value={this.state.message}
onChange={this.handleMessageChange}
/>
<FormFieldError
field={{ invalid: true }}
validations={{
response: 'Madness? This is Sparta!',
otherResponse: 'Wax on, wax off'
}}
/>
</FormFieldset>
<FormFooter>
<Button submit type="primary" onClick={this.handleSubmit}>
Submit
</Button>
</FormFooter>
</Form>
);
}
}
export default FormComponent;
FAQs
Cloudflare Form Component
The npm package @cloudflare/component-form receives a total of 6,211 weekly downloads. As such, @cloudflare/component-form popularity was classified as popular.
We found that @cloudflare/component-form demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 35 open source maintainers collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Oracle seeks to dismiss fraud claims in the JavaScript trademark dispute, delaying the case and avoiding questions about its right to the name.
Security News
The Linux Foundation is warning open source developers that compliance with global sanctions is mandatory, highlighting legal risks and restrictions on contributions.
Security News
Maven Central now validates Sigstore signatures, making it easier for developers to verify the provenance of Java packages.