Absent Member.
Absent Member.
249 views

Why did my javascript stop working after 11.6.1 upgrade?

Jump to solution
Hello,

I have some javascript that has stopped working after I upgraded to 11.6.1.

The routine below reads a list of checkboxes and hides the ones that are checked, which makes them read only. Also, when the list of checkboxes shows on the page they are checked, the routine would make those items "Unchecked".

Now after the upgrade the checkboxes that should not be checked are checked, and the checkboxes that should be disabled are showing, those are unchecked.

I have stepped through the debuggers on IE and Chrome, the lines of code are getting executed they just aren't displaying the output like the used to.

I have opened an incident with Micro Focus. Just covering all of my bases in case someone else has experienced this behavior and knows of a solution.


var transition_value_var = GetTransitionInternalName();
if (transition_value_var == "DESKTOP_ENVIRONMENT.UPDATE_LOWER_ENVIRONMENTS"
{
var unchecked_add_lower_var = GetFieldValue("ADD_LOWER_ENV_ACCESSED");
if (unchecked_add_lower_var != 1)
{
if (GetFieldWidgetByName) {
var x = $(GetFieldWidgetByName("AVAILABLE_LOWER_ENVIRONMEN")).find(":checkbox(:checked)");
for (i = 0; i < x.length; i++)
{
var y = x.checked
var z = x.value
if ( y == true )
{
$(":[value='"+ x.value +"']").attr("checked",false); // Makes sure the field is unchecked for available items.
//$(":[value='"+ x.value +"']").attr("value",false);
}
else
{
$(":[value='"+ x.value +"']").hide(); //Makes the checked items read only.
}
}
{ show_valid_dates_and_disable_them(); }
}
{add_lower_environments();}
SetFieldValues("ADD_LOWER_ENV_ACCESSED","1");
}
}
0 Likes
1 Solution

Accepted Solutions
Absent Member.
Absent Member.
Paul,

Thanks for having a look at it. I will double check your syntax recommendations.

Micro Focus got back to me this morning with:

"There is a mistake in jQuery selector like $(":value=...");
There is no such selectors as $(":value=...").

They should just remove colon before 'value' and use selector $("value=...") instead. "

When I remove the colon before 'value' it worked again.

Normally I would not have troubled MF with a coding issue but because the behavior changed after my upgrade I sent the issue in.

I'm not the best coder, I'm just persistent.

Thanks again,

Regards,

Will

View solution in original post

2 Replies
Fleet Admiral
Fleet Admiral
( ... just thinking out loud here ...)


  • Line 2 (if) doesn't hava closing right paren for "if" statement.
  • Lines 11 & 12 (var y,z) didn't have semi-colon line terminator.
  • According the a jQuery manual, the ":checked" selector is more efficient when explicitly prefixed with the INPUT tag, e.g. "input:checked".
  • I don't recognize the jQuery syntax for the "(:checked)" part of that but it obviously isn't restricting the search to "checked" checkboxes only, or the rest of the code wouldn't work.
  • Line 8 (var x) will set "x" to a collection of INPUT elements that are configured as check-boxes. This list is iterated looking for elements that are "selected" or "checked". Any elements that have the same "value" as any of the checked/selected element(s) are then unchecked / unselected. Any elements that have the same "value" as unchecked/unselected element(s) are hidden.


The first thing I'd do is check the versions of jQuery in your former and current version of SBM and see if there's any bugs related to ".hide()" or selection logic.
0 Likes
Absent Member.
Absent Member.
Paul,

Thanks for having a look at it. I will double check your syntax recommendations.

Micro Focus got back to me this morning with:

"There is a mistake in jQuery selector like $(":value=...");
There is no such selectors as $(":value=...").

They should just remove colon before 'value' and use selector $("value=...") instead. "

When I remove the colon before 'value' it worked again.

Normally I would not have troubled MF with a coding issue but because the behavior changed after my upgrade I sent the issue in.

I'm not the best coder, I'm just persistent.

Thanks again,

Regards,

Will

View solution in original post

The opinions expressed above are the personal opinions of the authors, not of Micro Focus. By using this site, you accept the Terms of Use and Rules of Participation. Certain versions of content ("Material") accessible here may contain branding from Hewlett-Packard Company (now HP Inc.) and Hewlett Packard Enterprise Company. As of September 1, 2017, the Material is now offered by Micro Focus, a separately owned and operated company. Any reference to the HP and Hewlett Packard Enterprise/HPE marks is historical in nature, and the HP and Hewlett Packard Enterprise/HPE marks are the property of their respective owners.