Form item prompt information setting method and device
By generating and processing templates to set form item prompt information, the problem that developers need to write form item prompt information code one by one is solved, and the effect of simplifying the development process and reducing the error rate is achieved.
Patent Information
- Application Number
- CN202411636297.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-11-15
- Publication Date
- 2025-03-04
AI Technical Summary
In the prior art, developers need to write code for prompt information one by one for each form item, resulting in increased development complexity and increased error rate.
Generate the target form page through the preset page generation method, obtain the form item label, and use the preset processing template to set the prompt information of the form item to avoid manually writing the prompt information code for each form item.
It simplifies the development process, reduces the error rate, and improves work efficiency. Regardless of the number of form items, the prompt information configuration can be efficiently completed through preset processing templates.
Smart Images

Figure CN119556926A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of computer technology, and in particular to a method and device for setting prompt information of a form item. Background Art
[0002] In various business systems, the form page is an interactive interface for information transmission between users and enterprises. Through the form page, users can submit information to apply for services, qualifications or other related cooperation.
[0003] However, in actual use, users often fill in incorrect information because they are not clear about the specific meaning of certain form items. In order to optimize the user experience and reduce the error rate, you can set prompt information for the form items to explain the meaning of the form items through prompt information, helping users to accurately understand and fill in relevant information.
[0004] However, in order to set these prompt messages, developers need to write prompt message codes for each form item one by one, which not only increases the complexity of development work, but also easily introduces errors due to negligence of details. Summary of the invention
[0005] In view of the above problems, the present invention provides a method and device for setting prompt information of form items. The main purpose is to solve the problem that in the current method for setting prompt information of form items, developers need to write prompt information code for each form item one by one, which makes development complicated and easy to introduce errors.
[0006] In order to solve the above technical problems, the present invention proposes the following solutions:
[0007] In a first aspect, the present invention provides a method for setting prompt information of a form item, the method comprising:
[0008] Generate a target form page using a preset page generation method;
[0009] Obtain multiple form item labels on the target form page;
[0010] The prompt information of the form items where the multiple form item tags are located is set using a preset processing template, wherein the preset processing template is a pre-set code module for configuring the prompt information.
[0011] In a second aspect, the present invention provides a device for setting prompt information of a form item, the device comprising:
[0012] A page generation unit, used to generate a target form page using a preset page generation method;
[0013] A label acquisition unit, used to acquire multiple form item labels on the target form page generated by the page generation unit;
[0014] The information setting unit is used to set the prompt information of the form items where the multiple form item labels obtained by the label obtaining unit are located by using a preset processing template, wherein the preset processing template is a pre-set code module for configuring the prompt information.
[0015] In order to achieve the above-mentioned purpose, according to a third aspect of the present invention, a storage medium is provided, wherein the storage medium includes a stored program, wherein when the program is running, the device where the storage medium is located is controlled to execute the prompt information setting method of the form item of the first aspect mentioned above.
[0016] In order to achieve the above object, according to a fourth aspect of the present invention, a processor is provided, the processor being used to run a program, wherein the program executes the method for setting prompt information of the form item of the first aspect when running.
[0017] By means of the above technical scheme, the present invention provides a method and device for setting prompt information of a form item. First, a target form page is created by a preset page generation method. Then, multiple form item tags are identified and obtained on the target form page. Finally, a preset processing template is applied to set the prompt information of the form items corresponding to these form item tags. The advantage of this method is that the preset processing template is a pre-set code module for configuring prompt information. Therefore, no matter how many form items there are, the configuration of prompt information can be efficiently completed through the code module in the preset processing template. Compared with the traditional manual coding method, this templated processing mechanism greatly reduces the coding workload, thereby simplifying the development process and reducing the potential error rate.
[0018] The above description is only an overview of the technical solution of the present invention. In order to more clearly understand the technical means of the present invention, it can be implemented according to the contents of the specification. In order to make the above and other purposes, features and advantages of the present invention more obvious and easy to understand, the specific implementation methods of the present invention are listed below. BRIEF DESCRIPTION OF THE DRAWINGS
[0019] Various other advantages and benefits will become apparent to those of ordinary skill in the art by reading the detailed description of the preferred embodiments below. The accompanying drawings are only for the purpose of illustrating the preferred embodiments and are not to be considered as limiting the present invention. Moreover, the same reference symbols are used throughout the accompanying drawings to represent the same components. In the accompanying drawings:
[0020] Figure 1 A flow chart of a method for setting prompt information for a form item provided by an embodiment of the present invention is shown;
[0021] Figure 2A flow chart of another method for setting prompt information of a form item provided by an embodiment of the present invention is shown;
[0022] Figure 3 A block diagram showing a device for setting prompt information for a form item provided by an embodiment of the present invention;
[0023] Figure 4 A block diagram showing another device for setting prompt information for a form item provided by an embodiment of the present invention;
[0024] Figure 5 An example diagram of a form item provided by an embodiment of the present invention is shown. DETAILED DESCRIPTION
[0025] The exemplary embodiments of the present disclosure will be described in more detail below with reference to the accompanying drawings. Although the exemplary embodiments of the present disclosure are shown in the accompanying drawings, it should be understood that the present disclosure can be implemented in various forms and should not be limited by the embodiments set forth herein. On the contrary, these embodiments are provided to enable a more thorough understanding of the present disclosure and to fully convey the scope of the present disclosure to those skilled in the art.
[0026] In the current method for setting prompt information for form items, developers need to write prompt information code for each form item one by one. This method not only increases the complexity of development work, but also easily introduces errors due to negligence in details. To this end, the inventor proposes a method for setting prompt information for form items. The method first generates a target form page through a preset page generation method, and then obtains multiple form item labels on the target form page. Finally, using a preset processing template, prompt information is set for the form item corresponding to the form item label, without the need for developers to manually write prompt information code for each form item one by one. This method not only significantly improves work efficiency, but also reduces the error rate caused by manual repetitive operations. The specific execution steps are as follows: Figure 1 As shown, including:
[0027] 101. Generate a target form page using a preset page generation method.
[0028] Before elaborating on the specific implementation methods of the embodiments of the present invention, it is first necessary to briefly introduce the executive body of the present invention. The executive body of the present invention is a form service system, which includes a field configuration module, a form generation module and a prompt information generation module. Through the field configuration module, various fields required for the form can be flexibly customized and configured; and the form generation module can generate a form page that meets the requirements based on these configurations. The prompt information generation module is responsible for setting prompt information for the form items in the generated form page. That is, through the collaboration of these modules, comprehensive support is provided for the creation, configuration and management of forms.
[0029] When generating a form page, you can use a variety of methods to meet the business needs of different business scenarios. One is to create a new form, which is suitable for scenarios that require completely customized form structures and fields, so that the form page fully meets specific business needs; the other is to customize the form based on the preset general form template, which helps improve development efficiency.
[0030] For the first method - creating a new form: it can be implemented in the form of container components. That is, a series of reusable form components are created in advance. After the field configuration module defines the field information of each form component according to business requirements, the form generation module can map these field information to the corresponding form components to dynamically generate corresponding form items. Finally, the generated form items are combined according to the predetermined layout and order to form a complete form page.
[0031] For the second type - customized modification based on the preset general form template: it can still be implemented in the form of container components. First, based on specific business needs, you can define the fields that need to be replaced or added through the field configuration module. Subsequently, the form generation module will map the new field information to the corresponding form component to generate the form items corresponding to the new fields, so that the modification of the existing general form page (that is, the general form template) can be completed to obtain the modified target form page. The above two methods can not only improve the efficiency of form development, but also make the maintenance and expansion of the form more convenient and flexible.
[0032] The reason why maintenance is easier is that component-based development splits the form page into multiple independent, reusable components. These components can be regarded as "function placeholders" that reserve positions on the interface to display specific content or functions. By dynamically adding, deleting, or rearranging these components in the container component, the target form page can be adjusted and reconstructed.
[0033] In addition, the form items in the form page are generated based on the field information, and the form items include form item labels and form controls. Users can use form controls, such as input boxes, selection boxes, or upload buttons, to fill in information corresponding to the form item labels by selecting, inputting, or uploading.
[0034] For example, the target form page can be a "student registration form" in an education platform, which contains multiple form items to collect students' basic information and registration requirements. These form item labels can include "date of birth", "student name", "desired course", etc. Next to each form item label is one or more form controls, such as a selection box or input box. Each form item label and the corresponding form control together constitute a complete form item. Figure 5 , Figure 5 An example diagram of form items provided for an embodiment.
[0035] The field information configured by the field configuration module should include at least the following items (that is, the field information may also include other options in addition to the following options, and this embodiment only lists the key items):
[0036] Field name: A unique name used to identify the field;
[0037] Field label (the label of the form item after the form item is generated): a descriptive text displayed to the user, explaining what the field requires input, such as "username", "email", etc.
[0038] Field type: used to define the data type and form control type of the field, such as text input box, password input box, radio button, check box, drop-down selection box, date picker, etc.
[0039] Default values: used to set the initial values of form fields. When the form is loaded, these values are automatically filled into the corresponding fields (such as date);
[0040] Required: Used to mark whether the form item corresponding to this field must be filled in before submitting the form;
[0041] Validation rules: including data format validation (such as email format, phone number format), length limit, range limit, etc., to ensure that the data entered by the user meets expectations;
[0042] Display position: used to indicate the arrangement order or layout information of the form items corresponding to a field in the form, such as row number and column number;
[0043] Custom attributes: Allows you to add additional HTML attributes to fields to support specific front-end interactions or styling needs.
[0044] In one embodiment, the field information configured by the field configuration module includes at least the above options, and when the field information is mapped to the form component, a complete form item is generated.
[0045] It should be noted that when configuring field information in the field configuration module, it is necessary to add designated field identifiers (i.e., unconventional fields) to those fields whose meanings are abstract or difficult to understand intuitively. The designated field identifiers are used to mark unconventional fields. The purpose of this is to distinguish these fields in the future and determine whether to add explanatory prompt information to the form items corresponding to these fields, so as to help users correctly grasp the meaning of the form items corresponding to each field, so as to complete the form filling accurately and efficiently.
[0046] In this embodiment, the designated field identifier may be a character of a special color. The designated field identifier is not only used to mark the unconventional field, but also applied to the label and form control of the form item finally generated according to the unconventional field.
[0047] For example, if the designated field marker is a yellow "*", the label and form control of the corresponding non-conventional field will be yellow, and the font color of the label of the corresponding form item will also be yellow. This design ensures that users can clearly identify which fields need special attention.
[0048] It should be noted that the unconventional fields mentioned in the embodiments of the present invention are used to indicate fields with abstract meanings or difficult to understand intuitively. Further defined, unconventional fields generally refer to fields with professional terms, specific abbreviations, or fields that require specific background knowledge to understand. Such fields may not be intuitive enough for ordinary users and require additional explanations or prompts to be filled in correctly.
[0049] In addition to highlighting the unconventional fields by color as mentioned above, the embodiments of the present invention also allow the presentation of these unconventional fields to be dynamically adjusted according to the user's operations in the form. Specifically, the user's operating behavior on the form controls is monitored through a monitoring mechanism. If the user stays on a certain control for more than a preset threshold, or enters information multiple times in the same control, the color of all unconventional fields in the form will flash or deepen to attract the user's attention; if the user successfully fills in the form items corresponding to multiple fields in a short period of time, the color of the unconventional fields can be appropriately weakened to keep the form interface tidy and reduce unnecessary interference. The purpose of this design is to promptly remind the user when the user encounters difficulties in filling out the form, so as to increase the user's caution when filling out the form. At the same time, when the user fills out the form successfully, the interface is kept simple and unnecessary interference is reduced, thereby improving the user experience.
[0050] Regular fields usually refer to those fields that are easy for users to understand and fill in. These fields often have clear and common names. Users often come into contact with them in daily life, so they can understand how to fill them in without additional explanation.
[0051] In some other embodiments, regular fields and non-regular fields can be set according to needs.
[0052] 102. Get multiple form item labels on the target form page.
[0053] After obtaining the target form page, a specific method can be used to obtain all form item labels on the target form page.
[0054] The specific method may be the document.querySelectorAll() method. This method is a tool provided by the Document Object Model (DOM) that allows the selection of tags in the form page through a CSS selector. Of course, other methods may also be flexibly selected and adopted according to the specific format and requirements of the target form page.
[0055] It is worth mentioning that after obtaining all the form item tags on the target form page, in order to ensure the orderly progress of the subsequent process, you can choose to add these form item tags to a tag list. The advantage of doing so is that the tag list can provide a structured framework so that each form item tag can be arranged in a certain order, which is convenient for management and processing. The orderliness of the tag list can ensure that each form item tag can be accessed and operated in an orderly manner in subsequent operations.
[0056] 103. Use the preset processing template to set the prompt information of the form items where multiple form item labels are located.
[0057] In this embodiment, according to the complexity of actual business requirements, prompt information of form items corresponding to each field in the target form page can be selectively set, or prompt information can be set for form items corresponding to unconventional fields with specified field identifiers.
[0058] For example, when the business requirements are more complex and the target form page does not include form item labels corresponding to common fields such as "name", you can choose to set prompt information for form items corresponding to all fields in the target form page.
[0059] It is worth noting that in order to enhance the viewability of the form page, the prompt information can be designed to be displayed dynamically. For example, when the user hovers the mouse over the form control of a target form item, the prompt information will be automatically displayed; when the mouse is moved away, the prompt information will be automatically hidden. Such an interactive design not only ensures the neatness of the interface, but also provides necessary help information when the user needs it.
[0060] Among them, the preset processing template refers to a pre-set code module that integrates event monitoring functions to display or hide prompt information, and can automatically calculate and determine the position, content and appearance style of the prompt box that displays the prompt information. This template is designed in a reusable format to simplify the development process. By applying such a preset template, developers can easily integrate dynamic interactive elements into the interface without having to write related logic from scratch, thereby improving the reusability and development efficiency of the code.
[0061] Based on the above Figure 1 It can be seen from the implementation method that the present invention provides a method for setting prompt information of a form item. First, a target form page is created by a preset page generation method. Then, multiple form item tags are identified and obtained on the target form page. Finally, a preset processing template is applied to set the prompt information of the form items corresponding to these form item tags. The advantage of this method is that the preset processing template is a pre-set code module for configuring prompt information. Therefore, no matter how many form items there are, the configuration of the prompt information can be efficiently completed through the code module in the preset processing template. Compared with the traditional manual coding method, this templated processing mechanism greatly reduces the coding workload, thereby simplifying the development process and reducing the potential error rate.
[0062] Furthermore, as a Figure 1 The embodiment shown in the figure is refined and extended. The embodiment of the present invention also provides another method for setting prompt information of a form item, such as Figure 2 As shown, the specific steps are as follows:
[0063] 201. Generate a target form page using a preset page generation method.
[0064] In this embodiment, the second method described in step 101 is adopted to construct the target form page, that is, the form page is constructed by customizing and modifying a pre-set general form.
[0065] In this embodiment, in order to further reduce the workload of back-end configuration, corresponding general form templates can be created in advance for different business scenarios based on the second method, and these business scenarios can be associated with corresponding general form templates (i.e., preset form pages) and saved. In this way, when facing the current business scenario, the corresponding preset form page can be retrieved and applied.
[0066] After obtaining the preset form page that matches the current business scenario, developers need to customize the preset form page in the field configuration module. This includes adding field information that does not exist in the preset form page or does not meet the specific business requirements of the current business scenario. During the configuration process, developers can identify unconventional fields that are difficult to understand (i.e., preset target fields) and add special designated field identifiers to these preset target fields to highlight their particularity.
[0067] In addition, if the preset form page already contains unconventional fields that meet business needs, but they lack corresponding designated field identifiers, they can also be reconfigured in the field configuration module to ensure that all unconventional fields can be properly identified and distinguished.
[0068] After completing the configuration of the field information, the form generation module can obtain the configured field set through the preset interface. Then, the form generation module will map the field information of each field to the corresponding form component of the preset form page, thereby generating form items for each preset field on the preset form page. This process completes the customized modification of the preset form page, and finally generates the target form page that meets specific business needs.
[0069] It should be noted that since the display position is defined in the field information of each field, the display position is used to indicate the arrangement order or layout information of the form items corresponding to a certain field in the form, such as row number, column number, etc. Based on this information, the corresponding form component can be accurately located and found, thereby ensuring that each form item is correctly displayed in the form according to the predetermined layout. The introduction of this mechanism allows the layout and order of the form to be flexibly adjusted to adapt to different designs and business needs.
[0070] In summary, this step can determine the corresponding preset form page according to the current business scenario, so that the generated form page can better match the specific application scenario, improving the relevance and pertinence of the page. In addition, the preset field set is obtained through the preset interface, and the field information is automatically mapped to the form component, and the form items of each preset target field are generated in the preset form page to obtain the target form page. This process simplifies the generation of form pages and improves development efficiency. The preset field set contains preset target fields with specified field identifiers. This identification mechanism helps to distinguish unconventional fields and ensure that these fields can receive special treatment or additional instructions when generating forms, thereby reducing user confusion and incorrect filling.
[0071] 202. Get multiple form item labels on the target form page.
[0072] Among them, the implementation method of step 202 is the same as the implementation method of step 102, and can achieve the same technical effect and solve the same technical problem, and will not be repeated here.
[0073] 203. Filter out a target form item tag from multiple form item tags using a preset filtering method.
[0074] 204. Use the preset processing template to set the prompt information of the target form item where the target form item label is located.
[0075] It should be noted that the field label and field type parameters in the field information can be used to render the form item label and form control in the form item corresponding to the field on the front-end page. For each field, the rendering process includes:
[0076] A unique ID is assigned to the form control generated according to the field type. The ID is usually a combination of the field name and a random number. Then, a for attribute value can be assigned to the form item label generated according to the field label, and the for attribute value is set to an association relationship with the ID of the form control corresponding to the same field. This association ensures the connection between the form item label and its corresponding form control. Therefore, when the user enters the corresponding value in the form control on the device, the value in the form control is considered to be the value corresponding to the form item label with a matching relationship.
[0077] In addition, the for attribute value (that is, the specified attribute value) of the form item tag can be consistent with the field name of the field to which it belongs. This design establishes a direct connection between the field, the form item label, and the form control.
[0078] After establishing direct connections between fields, form item labels and form controls, in step 203, the specified attribute values of multiple form item labels can be compared with the field names of preset target fields with specified field identifiers at the back end. In this way, the target form item labels that match the field names of the preset target fields can be identified from the multiple form item labels. Through this screening method, the system can automatically identify and select the form item labels that need to be set with prompt information, which reduces the workload of manual screening and improves efficiency. In addition, by comparing the specified attribute values of the form item labels with the field names in the preset field set in the screening method, the target form item labels that need to be processed can be accurately screened out, thereby avoiding error prompts caused by mismatching.
[0079] In this embodiment, performing the matching step is critical for two reasons:
[0080] First, in order to improve the user experience, this embodiment preferably adds prompt information only to the form controls in the form items corresponding to the preset target fields with the specified field identifiers.
[0081] Second, in the process of adding prompt information, how to accurately identify and locate the form controls corresponding to the preset target fields becomes a key issue.
[0082] Since there may be multiple form controls with similar appearances on a page, such as multiple input boxes or drop-down boxes, directly obtaining the form controls will not be able to distinguish which control corresponds to an unconventional field. However, the form item label is unique on the form page, and there is a direct correspondence between the specified attribute value of the form item label and the field name and the ID of the form control. By associating the specified attribute value of the form item label with the ID of the form control of the form item, the form control associated with the form item label can be quickly determined, ensuring that the prompt information can accurately point to the correct form element, thereby reducing user confusion caused by inaccurate positioning.
[0083] Therefore, all the form item labels on the target form page can be obtained first, and then the target form item label corresponding to the preset target field can be determined by matching the specified attribute value of the form item label with the field name of the preset target field. Then, the form control of the corresponding target form item can be found according to the target form item label, so as to add prompt information to the form item of the preset target field (i.e., the unconventional field). Such a process ensures that the prompt information can be correctly added to the form control associated with the preset target field, thereby improving the usability and user satisfaction of the form, so that the user can fill in the content corresponding to the unconventional field in the target form control according to the prompt information.
[0084] That is, adding prompt information to the target form item of the preset target field is to add prompt information to the target form control in the target form item, so that the user can fill in the content corresponding to the preset target field in the target form control according to the prompt information on the target form control. Specifically, the following process can be performed:
[0085] 1: Use the listening method to set the event listener on the target form control.
[0086] Among them, the event listener is used to monitor whether there is an interactive action for the target form control on the front-end page, and determine whether to display the prompt information corresponding to the target form control according to the monitoring result. That is, when the interactive action is monitored, the prompt information is displayed, and the interactive action stops and the prompt information is folded.
[0087] In this embodiment, the interactive action may be hovering the mouse over the target form control. However, if the user uses a touch screen device to fill in the target form, the interactive action may be the user's finger touching the target form control. This adaptability ensures that no matter what type of terminal device the user uses, the relevant operation or prompt information can be triggered through a suitable interactive method.
[0088] 2. Use the callback function in the event listener to determine the display position, content, and display style of the prompt box corresponding to the target form control:
[0089] Specifically, a callback function can be defined in the event listener in advance, and the callback function will be triggered when the user performs a specific interactive action. When the callback function is called, the content of the prompt box can be generated according to the function content, the display position can be calculated, and the display style can be determined.
[0090] When determining the display position of the prompt box, first use JavaScript code to obtain the relative position of the target form control in the window and the size of the target window. With this information, the callback function uses the size and relative position of the target window to calculate the optimal display position of the prompt box, ensuring that the prompt box is close to the relevant form control but does not exceed the visible area of the window. In addition, because this method combines the size of the target window, it can support changes in devices of different sizes and screen resolutions, so that the prompt box can be displayed correctly on various devices, enhancing the adaptability of the application.
[0091] The definition of the prompt box display style in the callback function includes but is not limited to the background color, border style, font size and color, shadow effect, etc. of the prompt box. These styles can be set directly in JavaScript through CSS classes or inline styles.
[0092] 3: Encapsulate the display position, content and display style of the prompt box in the preset storage object (objPopover object) of the event listener;
[0093] 4. Send the preset storage object to the preset prompt box component to generate prompt information of the target form control that conforms to the display position, content and display style of the prompt box.
[0094] Through the above prompt information generation process, it can be understood that the preset processing template covers the following key steps: setting event listeners, calling callback functions to generate the display style, content and position of the prompt box, and passing the display style, content and position information of the prompt box to the preset prompt box component, so as to complete the prompt information setting of the target form control. By setting event listeners to monitor the interactive actions on the front-end page, it can respond to user operations intelligently and display prompt information only when relevant interactions are detected, thereby improving the relevance and practicality of the prompt information. In addition, the display position, content and style of the prompt box are dynamically determined by the callback function in the event listener, ensuring that the prompt information can be adjusted in real time according to the current environment and user behavior, thereby enhancing the user experience. Finally, the display parameters of the prompt box are encapsulated in a preset storage object, and the prompt information is generated by sending the storage object to the preset prompt box component, realizing the decoupling of functions, so that the prompt box component can be updated independently without affecting other parts, and improving the scalability and flexibility of the system.
[0095] In order to improve the reusability and flexibility of the code, each process in the above preset processing template can be encapsulated in a high-order function. In this way, when the specific content of the prompt information needs to be replaced or updated, it is only necessary to simply adjust the parameter value of the corresponding function in the high-order function. Developers do not need to write prompt information code for each form item separately, but only need to maintain a set of preset processing templates. This modular and parameterized design mode makes it easy to customize and update prompt information, greatly improving development efficiency and system maintainability.
[0096] Furthermore, as a response to the above Figure 1 In order to realize the method shown in the figure, the embodiment of the present invention also provides a prompt information setting device for a form item, which is used for Figure 1 The device embodiment corresponds to the aforementioned method embodiment. For ease of reading, this device embodiment will not repeat the details of the aforementioned method embodiment one by one, but it should be clear that the device in this embodiment can correspond to all the contents of the aforementioned method embodiment. Figure 3 As shown, the device comprises:
[0097] The page generating unit 301 is used to generate a target form page by using a preset page generating method;
[0098] The label acquisition unit 302 is used to acquire multiple form item labels on the target form page generated by the page generation unit 301;
[0099] The information setting unit 303 is used to set the prompt information of the form item where the multiple form item tags obtained by the tag obtaining unit 302 are located by using a preset processing template, wherein the preset processing template is a pre-set code module for configuring prompt information.
[0100] Furthermore, as a response to the above Figure 2 In order to realize the method shown in the figure, the embodiment of the present invention also provides another prompt information setting device for a form item, which is used for Figure 2 The device embodiment corresponds to the aforementioned method embodiment. For ease of reading, this device embodiment will not repeat the details of the aforementioned method embodiment one by one, but it should be clear that the device in this embodiment can correspond to all the contents of the aforementioned method embodiment. Figure 4 As shown, the device comprises:
[0101] The page generating unit 301 is used to generate a target form page by using a preset page generating method;
[0102] The label acquisition unit 302 is used to acquire multiple form item labels on the target form page generated by the page generation unit 301;
[0103] The information setting unit 303 is used to set the prompt information of the form item where the multiple form item tags obtained by the tag obtaining unit 302 are located by using a preset processing template, wherein the preset processing template is a pre-set code module for configuring prompt information.
[0104] In an optional implementation manner, the information setting unit 303 includes:
[0105] The tag filtering module 3031 is used to filter out a target form item tag from the multiple form item tags by using a preset filtering method;
[0106] The information setting module 3032 is used to set the prompt information of the target form item where the target form item label filtered by the label filtering module 3031 is located by using a preset processing template.
[0107] In an optional implementation manner, the tag screening module 3031 is specifically used for:
[0108] Obtaining specified attribute values of multiple form item tags, wherein the specified attribute value of each form item tag is associated with the ID of the form control of the form item, and is the same as the field name in the field information of the field corresponding to the form item;
[0109] Matching the specified attribute values of the multiple form item tags with the field names of the preset target fields in the preset field set to obtain a matching result;
[0110] According to the matching results, a target form item label having the same field name as each preset target field is determined.
[0111] In an optional implementation manner, the information setting module 3032 is specifically used to:
[0112] Determine a target form control associated with the target form item tag by using a specified attribute value of the target form item tag;
[0113] The prompt information of the target form control is set using a preset processing template.
[0114] In an optional implementation manner, when the information setting module 3032 sets the prompt information of the target form control using a preset processing template, it is specifically used to:
[0115] Using a monitoring method to set an event listener on the target form control, the event listener is used to monitor whether there is an interactive action for the target form control on the front-end page, and determine whether to display the prompt information corresponding to the target form control according to the monitoring result;
[0116] Using the callback function in the event listener, determine the display position, content and display style of the prompt box corresponding to the target form control;
[0117] Encapsulating the display position, content and display style of the prompt box in a preset storage object of the event listener;
[0118] The preset storage object is sent to a preset prompt box component to generate prompt information of the target form control that conforms to the display position, content and display style of the prompt box.
[0119] In an optional implementation manner, when the information setting module 3032 uses the callback function in the event listener to determine the display position of the prompt box corresponding to the target form control, it is specifically used to:
[0120] Obtaining the size of a target window, where the target window is a window used to display a target form page;
[0121] Obtaining the relative position of the target form control in the target window;
[0122] The display position of the prompt box corresponding to the target form control is determined based on the size of the target window and the relative position.
[0123] In an optional implementation manner, the page generating unit 301 includes:
[0124] The page determination module 3011 is used to determine the corresponding preset form page according to the current business scenario;
[0125] A field acquisition module 3012, configured to acquire a preset field set according to a preset interface, wherein the preset field set includes a preset target field having a specified field identifier, and the specified field identifier is used to indicate that the preset target field is a non-conventional field;
[0126] The page generation module 3013 is used to map the field information of each preset field obtained by the field acquisition module 3012 to multiple specified form components in the preset form page determined by the page determination module 3011, generate form items of each preset field in the preset form page, and obtain the target form page.
[0127] Furthermore, an embodiment of the present invention further provides a storage medium, wherein the storage medium is used to store a computer program, wherein when the computer program is running, the device where the storage medium is located is controlled to execute the above Figure 1-2 The method for setting the prompt information of the form items described in .
[0128] Furthermore, an embodiment of the present invention further provides a processor, the processor is used to run a program, wherein the program executes the above Figure 1-2 The method for setting the prompt information of the form items described in .
[0129] In the above embodiments, the description of each embodiment has its own emphasis. For parts that are not described in detail in a certain embodiment, reference can be made to the relevant descriptions of other embodiments.
[0130] It is understandable that the related features in the above methods and devices can be referenced to each other. In addition, the "first", "second" and the like in the above embodiments are used to distinguish the embodiments, but do not represent the advantages and disadvantages of the embodiments.
[0131] Those skilled in the art can clearly understand that, for the convenience and brevity of description, the specific working processes of the systems, devices and units described above can refer to the corresponding processes in the aforementioned method embodiments and will not be repeated here.
[0132] The algorithm and display provided herein are not inherently related to any particular computer, virtual system or other device. Various general purpose systems can also be used together with the teachings based on this. According to the above description, it is obvious that the structure required for constructing such systems. In addition, the present invention is not directed to any specific programming language either. It should be understood that various programming languages can be utilized to realize the content of the present invention described herein, and the description of the above specific languages is for disclosing the best mode of the present invention.
[0133] In addition, the memory may include non-permanent memory in a computer-readable medium, random access memory (RAM) and / or non-volatile memory in the form of read-only memory (ROM) or flash RAM, and the memory includes at least one memory chip.
[0134] Those skilled in the art will appreciate that the embodiments of the present application may be provided as methods, systems, or computer program products. Therefore, the present application may adopt the form of a complete hardware embodiment, a complete software embodiment, or an embodiment in combination with software and hardware. Moreover, the present application may adopt the form of a computer program product implemented in one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) that include computer-usable program code.
[0135] The present application is described with reference to the flowcharts and / or block diagrams of the methods, devices (systems), and computer program products according to the embodiments of the present application. It should be understood that each process and / or box in the flowchart and / or block diagram, as well as the combination of the processes and / or boxes in the flowchart and / or block diagram, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, an embedded processor, or other programmable data processing device to generate a machine, so that the instructions executed by the processor of the computer or other programmable data processing device generate instructions for implementing the processes in the flowchart and / or block diagram. Figure 1 A process or multiple processes and / or boxes Figure 1 A device that provides the functions specified in a block or multiple blocks.
[0136] These computer program instructions may also be stored in a computer-readable memory capable of directing a computer or other programmable data processing device to operate in a specific manner, so that the instructions stored in the computer-readable memory produce an article of manufacture comprising an instruction device, which implements the process Figure 1 A process or multiple processes and / or boxes Figure 1 A function specified in one or more boxes.
[0137] These computer program instructions can also be loaded onto a computer or other programmable data processing device so that a series of operating steps are executed on the computer or other programmable device to produce a computer-implemented process, thereby providing instructions for implementing the process. Figure 1 A process or multiple processes and / or boxes Figure 1 The steps for the functions specified in one or more boxes.
[0138] In a typical configuration, a computing device includes one or more processors (CPU), input / output interfaces, network interfaces, and memory.
[0139] The memory may include non-permanent memory in a computer-readable medium, random access memory (RAM) and / or non-volatile memory in the form of read-only memory (ROM) or flash RAM. The memory is an example of a computer-readable medium.
[0140] Computer readable media include permanent and non-permanent, removable and non-removable media that can be implemented by any method or technology to store information. Information can be computer readable instructions, data structures, program modules or other data. Examples of computer storage media include, but are not limited to, phase change memory (PRAM), static random access memory (SRAM), dynamic random access memory (DRAM), other types of random access memory (RAM), read-only memory (ROM), electrically erasable programmable read-only memory (EEPROM), flash memory or other memory technology, compact disk read-only memory (CD-ROM), digital versatile disk (DVD) or other optical storage, magnetic cassettes, magnetic tape magnetic disk storage or other magnetic storage devices or any other non-transmission media that can be used to store information that can be accessed by a computing device. As defined herein, computer readable media does not include temporary computer readable media (transitory media), such as modulated data signals and carrier waves.
[0141] It should also be noted that the terms "include", "comprises" or any other variations thereof are intended to cover non-exclusive inclusion, so that a process, method, commodity or device including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, commodity or device. In the absence of more restrictions, the elements defined by the sentence "comprises a ..." do not exclude the existence of other identical elements in the process, method, commodity or device including the elements.
[0142] Those skilled in the art will appreciate that the embodiments of the present application may be provided as methods, systems or computer program products. Therefore, the present application may adopt the form of a complete hardware embodiment, a complete software embodiment or an embodiment in combination with software and hardware. Moreover, the present application may adopt the form of a computer program product implemented on one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) that contain computer-usable program code.
[0143] The above are only embodiments of the present application and are not intended to limit the present application. For those skilled in the art, the present application may have various changes and variations. Any modification, equivalent replacement, improvement, etc. made within the spirit and principle of the present application should be included within the scope of the claims of the present application.
Claims
1. A method for setting prompt information of a form item, characterized in that: The method comprises: Generate a target form page using a preset page generation method; Obtain multiple form item labels on the target form page; The prompt information of the form items where the multiple form item tags are located is set using a preset processing template, wherein the preset processing template is a pre-set code module for configuring the prompt information.
2. The method according to claim 1, characterized in that Using a preset processing template to set prompt information of the form items where the multiple form item labels are located includes: Filtering out a target form item tag from the multiple form item tags using a preset filtering method; The preset processing template is used to set the prompt information of the target form item where the target form item label is located.
3. The method according to claim 2, characterized in that Filtering out a target form item tag from the multiple form item tags using a preset filtering method includes: Get the specified attribute values of multiple form item tags, where the specified attribute value of each form item tag is the same as the field name in the field information of the field corresponding to the form item; Matching the specified attribute values of the multiple form item tags with the field names of the preset target fields in the preset field set to obtain a matching result; According to the matching results, a target form item label having the same field name as each preset target field is determined.
4. The method according to claim 2, characterized in that: The preset processing template is used to set the prompt information of the target form item where the target form item label is located, including: Determine a target form control associated with the target form item tag by using the specified attribute value of the target form item tag, wherein the specified attribute value of each form item tag is associated with the ID of the form control of the form item; The prompt information of the target form control is set using a preset processing template.
5. The method according to claim 4, characterized in that The prompt information of the target form control is set by using a preset processing template, including: Using a monitoring method to set an event listener on the target form control, the event listener is used to monitor whether there is an interactive action for the target form control on the front-end page, and determine whether to display the prompt information corresponding to the target form control according to the monitoring result; Using the callback function in the event listener, determine the display position, content and display style of the prompt box corresponding to the target form control; Encapsulate the display position, content and display style of the prompt box in a preset storage object of the event listener; The preset storage object is sent to a preset prompt box component to generate prompt information of the target form control that conforms to the display position, content and display style of the prompt box.
6. The method according to claim 5, characterized in that Determining the display position of the prompt box corresponding to the target form control by using the callback function in the event listener includes: Obtaining the size of a target window, where the target window is a window used to display a target form page; Obtaining the relative position of the target form control in the target window; The display position of the prompt box corresponding to the target form control is determined based on the size of the target window and the relative position.
7. The method according to claim 1, characterized in that Generate the target form page using the preset page generation method, including: Determine the corresponding preset form page based on the current business scenario; Acquire a preset field set according to a preset interface, wherein the preset field set includes a preset target field with a specified field identifier, and the specified field identifier is used to indicate that the preset target field is an unconventional field; The field information of each preset target field is respectively mapped to a plurality of designated form components in the preset form page, and form items of each preset target field are generated in the preset form page to obtain a target form page.
8. A device for setting prompt information of a form item, characterized in that: The device comprises: A page generation unit, used to generate a target form page using a preset page generation method; A label acquisition unit, used to acquire multiple form item labels on the target form page generated by the page generation unit; The information setting unit is used to set the prompt information of the form items where the multiple form item labels obtained by the label obtaining unit are located by using a preset processing template, wherein the preset processing template is a pre-set code module for configuring the prompt information.
9. A storage medium, characterized in that: The storage medium includes a stored program, wherein when the program is running, the device where the storage medium is located is controlled to execute the method for setting prompt information of a form item according to any one of claims 1 to 7.
10. A processor, characterized in that: The processor is used to run a program, wherein the program executes the method for setting prompt information of a form item according to any one of claims 1 to 7 when running.