簡體   English   中英

javascript-如何僅將文本添加到表單輸入

[英]javascript - How to just add text to a form input

我已經有一個完整的javascript表單。 我需要的只是一個簡單的label Lol。

它使用的是先前的代碼,但希望此摘要可以幫助您了解正在發生的事情:

export default class NewEvent extends FormStep {

    get inputs() {
        return [{
            name: 'department',
            label: 'Department / Specific Ministry'
        }, {
            name: 'title'
        }, {
            name: 'description',
            type: 'textarea'
        }, {
            name: 'checkboxApproved',
            type: 'checkbox',
            label: 'This copy is approved and is to be used as written.'
        }, {
            name: 'checkboxDetails',
            type: 'checkbox',
            label: 'These are the details! Please help me write a catchy description.'
        }, {
            name: 'location'
        }, {
            name: 'contactName',
            label: 'Event Contact Name'
        }, {
            name: 'contactEmail',
            label: 'Event Contact Email (required)'
        }, {
            name: 'contactPhone',
            label: 'Event Contact Phone (optional)'
        }, {
            name: 'eventURL'
        }, {
            name: 'isNewHRock',
            type: 'checkbox',
            label: 'This event is a new event we\'ve never done at HRock.'
        }, {
            name: 'hasOccurred',
            type: 'checkbox',
            label: 'We\'ve had this event before, but it is not on a recurring schedule.'
        }, {
            name: 'needsRegistration',
            type: 'checkbox',
            label: 'We need to set up registration for this event.'
        }, <EventPrice key = 'eventPrice' /> , <EventClassInfo key = 'eventClassInfo' /> , <EventDateTimeInfo key = 'eventDateTimeInfo' /> ]
    }
}

無論如何,所有這些項目都顯示為表格。 他們應該。 但我只想在復選框之間添加標簽。 我創建了以下要添加的屏幕截圖

在此處輸入圖片說明

但是,到目前為止,每當我在其中添加text時,它都會破壞代碼,或者顯示在textfield

救命?

這是“輸入”的對象。 解析該對象的函數都是使用它創建所有輸入,這就是為什么要獲得文本框的原因。 我認為這不是代碼中執行此操作的正確位置。

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM