Answered: How to put placeholder in ask page and in answer form ?

Post date: 2021-05-03 02:06:30
Views: 80

You mean for input fields and/or textareas? I don't think there's a simple way of doing this, at least not via PHP. For the title field of the "ask" page you could insert a placeholder attribute in your theme like this:

public function main_part($key, $part) {
  ...
  if ($key == "form") {
    $part'fields']'title']'tags'] .= ' placeholder="foobar"';
  }
  ...
}

However, for the content textarea the required change would depend on what editor you're using AFAICS.

Maybe you could do this with a JavaScript inserted in every page. However, then you'd have to detect the page type in the script, so your modification only applies to the desired pages, and this approach won't work when users have JavaScript disabled.

Also, keep in mind that using placeholders in HTML is not without issues:

Please click Here to read the full story.
 
Other Top and Latest Questions:
What will it take to get tech stocks rising again? An unemployment rate above 4%
China is still years behind the U.S. despite Huawei's breakthrough chips, Raimondo tells '60 Minutes'
AIG Travel Guard insurance review: What you need to know
83% of teenagers are already thinking about retirement — but many make this one mistake
Any good articles about homelessness and "authority" in the US?
Should I buy some facebook fixit car paint
How can i solve the problem?
Trump trial: Ex-National Enquirer publisher David Pecker is first prosecution witness to testify
Movie: Life Is Sweet
Fallout: The Past