Questions and discussion about developing processes and programming in PHP, JavaScript, web services & REST API.

Moderator: ArturoRobles

Forum rules: Please search to see if a question has already asked before creating a new topic. Please don't post the same question in multiple forums.
By aura9k1
#815479
Good day,

Is there a way to change the Placeholder value of a field using Javascript? Using setValue or setText does of course not achieve the required result.
By ewallace
#829170
Given a main form named "Employee Info" which includes a subform named, "subform Checklist", which has a dropdown control named "Department Head", how would I set the PLACEHOLDER for "Department Head" via JavaScript?

Explanation of partial trigger code further below:
"departmentHead" is a dropdown on "subform Checklist" with a PLACEHOLDER of "Please select from list"
If they select "yes" for "bannerAccount", select a value from the dropdown for "departmentHead", then set "bannerAccount" back to "no", I clear the value for "departmentHead".

However, this eliminates the "Please select from list" PLACEHOLDER if they later change "bannerAccount" back to "yes",
thus displaying the top value for "departmentHead" by default.

How do I set "departmentHead" back to the PLACEHOLDER value after I clear it?

function showOrHide_bannerAccountDetails() {
if ($("#bannerAccount").getValue() === "yes") {
$("#departmentHead").show();
$("#departmentHead").enableValidation();
$("#accessPrivsLike").show();
$("#additionalBannerAccess").show();
...
} else {
$("#departmentHead").hide();
$("#departmentHead").disableValidation();
$("#departmentHead").setValue("");
...
User avatar
By kirkwg
#829173
Hi there,

I want to help but still don't get a full picture for your question? Mind to draw a picture or give example to show what is before it looks like and what is after it looks like?? Thanks.
User avatar
By kirkwg
#829178
Hi there,

Thanks for your explanation, now I understand your issue. What you had encountered the behaviors were normal, if based on processmaker doc below for 1/ and 2/:

1/Only the dropdown control always selects a value when it is first rendered. In order to define an empty or null value, create an option without value and add any description such as “--Select an option--”.

2/ Placeholder - Once an option is selected the placeholder will disappear.

//my suggestion below:
Placeholder only show one time at initial, once you have selected an option or you reset it to empty "" by JS, the same, won't show the placeholder again.

Solution: e.g. add " --Please select a choice--" as a null choice and check later
-- --Please select a choice--
NEW NEW
PREV Take over previous number

Cheers...
SCHEDULER MISSING

Your article is very good I like it. and also ever[…]

Data Loss

Hi, In some cases I have a problem, the data is a[…]

Enabling SQL Server in Windows

All the stuffs here are new things and interesting[…]

Dispose of your financial task misfortunes by pr[…]