This topic is locked

help placeholder date

8/9/2025 7:57:13 AM
ASPRunner.NET General questions
M
max benelli author

Hi, first of all, thank you for your help yesterday.
But today I have another problem.
I tried this, but it doesn't work.
var ctrl = Runner.getControl(pageid, 'datainsrimento1'.placeholder = "gg/mm/aaaa");

ChatGPT 8/9/2025

It looks like you're trying to set a placeholder for a control in ASPRunner.NET using JavaScript. However, your syntax seems to be incorrect. The line you provided has an assignment operation (=) where it should be using a method to set the placeholder.

Here's how you can properly set the placeholder for a control using JavaScript in ASPRunner.NET:

var ctrl = Runner.getControl(pageid, 'datainsrimento1');
ctrl.setPlaceholder("gg/mm/aaaa");

In this code:

  • Runner.getControl(pageid, 'datainsrimento1') retrieves the control, and you store it in the variable ctrl.
  • Then, you use the setPlaceholder method to set the placeholder text.

Make sure that datainsrimento1 is the correct control name and that the page ID (pageid) is also set correctly in your context. If you run this code after the page has fully loaded, it should work as expected.

Let me know if you have any further questions or issues!

M
max benelli author 8/9/2025

hanks,
but it doesn't work
perhaps because it's a control on the search page in date format, but I also tried changing the format properties to text, but nothing changed

in the database and in date and time format.