Get Text Field content in tagify

Hello! I have selected using the tagify tool. Is it possible to get the value of the Text Field after submitting the form? I want to display it in notifies.

Do you want the text entered in the tagify or the actual value of the input?

I need text entered in the tagify.

Screenshot_1

So you want to show this in a dynamic onsubmit event in a notify?

Yes exactly )

You can add this to your form:

 dmx-on:submit="notifies1.info(text1.items[0].name))"

replace text1 with your input.

This is how I get the ID (value):
notifies1.success(companyId.value)

Input has this code:
image

I need to get tag-text=“companyName”

 dmx-on:submit="notifies1.info(companyId.items[0].name))"

This code is not working (

Which part is not working? Is the notification showing or not?
Paste your whole form code here please.

Is the notification showing.

Here is the form code:

<form action="/api/managers/add_companyid_create_rec" method="post" id="addCompanyId" is="dmx-serverconnect-form" dmx-on:success="sc_show_companyid_create_rec.load();sc_select_company_items_rec.load();sc_all_order_items_rec.load();userLoggedin.set('addcompanyidrec',1,{});addCompanyId.reset()" dmx-on:submit="notifies1.info(companyId.name))">
                                            <div class="row">
                                                <div class="col-12">
                                                    <div class="card-style settings-card-1 mb-30">
                                                        <div class="row justify-content-lg-center">
                                                            <div class="col-lg-5">
                                                                <div class="input-style-1 mb-0">
                                                                    <input type="text" id="companyId" name="companyId" placeholder="Company Name*" required="" is="dmx-tagify" dmx-bind:data="sc_all_companies.data.api_all_companies.data.payload" mode="select" tag-value="id" nocustom="true" max-tags="1" max-items="1000" tag-text="companyName">
                                                                </div>
                                                            </div>
                                                            <!-- end col-lg-5 -->

                                                            <div class="col-lg-2">
                                                                <button style="padding-top: 8px; padding-bottom: 8px;" class="main-btn primary-btn btn-hover fsz-16" type="submit">
                                                                    Select a Company
                                                                </button>
                                                            </div>
                                                            <!-- end col-lg-2 -->
                                                        </div>
                                                        <!-- end row -->
                                                    </div><!-- card-style -->

                                                    <!-- end card -->
                                                </div>
                                                <!-- end col -->

                                            </div>
                                            <!-- end row -->
</form>

But you said earlier you want to use the onsubmit event, now i see you have quite a lot going on onsuccess … including reset of the tagify input.

Try changing this:

dmx-on:success="sc_show_companyid_create_rec.load();sc_select_company_items_rec.load();sc_all_order_items_rec.load();userLoggedin.set('addcompanyidrec',1,{});addCompanyId.reset()" dmx-on:submit="notifies1.info(companyId.name))"

to:

dmx-on:success="notifies1.info(companyId.items[0].name));sc_show_companyid_create_rec.load();sc_select_company_items_rec.load();sc_all_order_items_rec.load();userLoggedin.set('addcompanyidrec',1,{});addCompanyId.reset()"

You cannot access the selected value after you reset the input value …

Doesn’t display the value of the text field (

Can you try removing all other events on success and leave just the one for the notify then test if it shows the value?

companyId.name - Nothing output

companyId.value - The ID of the object is displayed

This has nothing to do with the code i provided!

It must be exactly:

companyId.items[0].name

And the whole notify code:

notifies1.info(companyId.items[0].name))

Left only this code:

dmx-on:success=“notifies1.info(companyId.items[0].name)”

Nothing output

Can you open your browser console and enter dmx.app.data after you select your value and before you submit the form.
Expand the tree until you go to the notify and send me a screenshot of what do you see:

Or just provide a link to your page where i can check.

Got it! It should have been done like this:

dmx-on:success=“notifies1.info(companyId.items[0].companyName)”

My input has the following code:

<input type="text" id="companyId" name="companyId" placeholder="Company Name*" required="" is="dmx-tagify" dmx-bind:data="sc_all_companies.data.api_all_companies.data.payload" mode="select" tag-value="id" nocustom="true" max-tags="1" max-items="1000" tag-text="companyName">

Thanks for your help Teodor )

1 Like