Skip to main content
Announcements
Join us at Qlik Connect for 3 magical days of learning, networking,and inspiration! REGISTER TODAY and save!
cancel
Showing results for 
Search instead for 
Did you mean: 
Rav3
Contributor II
Contributor II

Mashups Clear funtion

i am new to Mashups, want to clear selected field

How can We write Html for this Below Java script.

var config = {

host: window.location.hostname,

prefix: prefix,

port: window.location.port,

isSecure: window.location.protocol === "https:"

};

require(["js/qlik"], function(qlik) {

// open the app

var app = qlik.openApp('c31e2aba-3b46-4b13-8b87-c5c2514dea1d', config);

//get a field reference and clear the field selection var lastNameField = app.field('LastName'); lastNameField.clear(); });

Thanks,

Ravi

2 Replies
ErikWetterberg

Hi,

If you want to create a button the user can click to clear this field you could do something like this:

<button type="button" id="clrfld" class="btn btn-primary">Clear field</button>

And then in your javascript:

var app = openApp(......);

$( '#clrfld' ).click( function () {

  app.field('LastName').clear();

} );

Hope this helps

Erik Wetterberg

nvrphanikumar
Creator
Creator

Thank you!, Was searching for an answer and came across this