Menu

Solutions to Problems or Custom Needs in a Website

Many solutions we create for one site can be used and appreciated on other sites also.

Have a look at this list of components and solutions we have developed over time and if you could benefit from any of them you are welcome to them.

Please let us know if you would like to discuss the details or would like some help getting one installed.

Set the value of Dropdown with Auto Complete

Mark Buelsing 0 2677 Article rating: No rating

Use this function to set the value of a dropdown with auto complete

function setAutocompletCurrentValue(id, value) {
   $(id).val(value);
   var textToShow = $(id).find(":selected").text();
   $(id).parent().find("span").find("input").val(textToShow);
}

Called like this:

setAutocompletCurrentValue(dnn843GCSFieldName, 'test');

Notes:

The value you set it to must be a correct choice for the control from its dataset,

Not sure if the single quotes are needed or not.

Prevent a Form Submit

Mark Buelsing 0 0 Article rating: No rating

To prevent a page refresh you have 3 options:

If you are working with a button.

1. return false  - on change/click  - which will stop execution of all actions on the button (as the on change/click javascript executes first)

2. return false; - but move it from the on change/click area to an Execute JavaScript action which you place as the last action on the submit button

3. Update Form AJAX as the last action on the button; this will submit and then refresh your form without refreshing the page.

Set initial date of Date Time Picker for a future date

Mark Buelsing 0 2182 Article rating: No rating

To create a date 2 weeks in the future, simply use the following token: [DateTime:Relative(Add="2 Week")|yyyy-MM-dd] for the Initial Value setting.

If you are getting your date from SQL, for the "Initial" value ... what I have used successfully from SQL DateTime retreived fields is the following: [MyVariable:ISOAsUtc]

From Ben Santiardo

https://community.plantanapp.com/Forum/Question-Details?qid=1388

RSS
1234567
RSS
1234