jQWidgets Forums
jQuery UI Widgets › Forums › Editors › Input, Password Input, TextArea, ColorPicker, Rating, TagCloud, Loader › Reset jqxInput back to prompt
Tagged: Input, javascript input, jQuery Input
This topic contains 1 reply, has 2 voices, and was last updated by Peter Stoev 9 years, 4 months ago.
-
Author
-
In the Init content of the popup window, I initialize an input box with a prompt string and no value selected
$("#PopUpAddCAPAWindow").jqxWindow({ theme: 'oriasmenu', width: 900, height: 650, resizable: false, isModal: true, autoOpen: false, cancelButton: $("#aCancelCAPA"), modalOpacity: 0.2, showCloseButton: true, initContent: function () { //** Set the format for the window and initialize all the controls in it (set values in the window open function beacuse this only runs once) $("#aCapaRespEmp").jqxInput({ source: asearchActiveEmpAdapter, placeHolder: vEmpSearchPrompt, displayMember: "s_EmpSearchStr", valueMember: "s_EmpID", width: 240, height: 20 });
The popup window is repetitively opened and closed. When it is opened again, I want to reset the aCapaRespEmp control so it is back to the placeholder prompt and nothing is selected.
The alert is happening, but the placeholder remains what was selected the last time the window was open (however there is no value selected). Can you please tell me what I am missing.
$('#PopUpAddCAPAWindow').on('open', function (event) { // vCAPAIsUpdated = 'N'; //init so it only updates once //**** When the Add window is opened, set the default values of the controls - have to do this each time the window is opened to //**** refresh the controls from a previous add if not the first time in alert('resetting'); alert('vRespPersonEID=' + vRespPersonEID); //this alert happens is null so it's not holding it $("#aCapaRespEmp").jqxInput({ placeHolder: vEmpSearchPrompt //this doesn't seem to do anything - the prompt doesn't show back up just leaves it blank. });
Thanks!
Hi sjkcwatson,
placeHolder is displayed when the input’s value is empty so set the Input’s value to an empty string and the place holder will be displayed.
Best Regards,
Peter StoevjQWidgets Team
http://www.jqwidgets.com -
AuthorPosts
You must be logged in to reply to this topic.