Anonymous_User Absent Member.
Absent Member.
367 views

JQuery Implementation in PRD forms


Hi Folks,

I am trying to call JQuery Script on "onChange" Event of a Particular
Field(DataType: String, Control:Text) on My PRD Form.
Steps I have Followed:-
1) Introduced JQuery Libraries viz.jquery 1.3.2.min.js and
jquery-ui-1.7.2.custom.min.js to my local environmeent (Scripts Tab:-
Script name, External & Path of Libraries).
2) On clicking the URL, able to Retrieve Library file Contents on
ECMAScript Panel screen.
3) created a Jquery Script and made it an inline Type of Script.
4) Trying to call The Inline script on "onChange" Event of a Text
field.

Unable to introduce.:(

Please Help In this Regard.
Any Example, Reference/Document for the same will be highly
Appreciated.:)

Regards,
Anand


--
anjha0049
------------------------------------------------------------------------
anjha0049's Profile: https://forums.netiq.com/member.php?userid=5837
View this thread: https://forums.netiq.com/showthread.php?t=49265

Labels (1)
0 Likes
6 Replies
Anonymous_User Absent Member.
Absent Member.

Re: JQuery Implementation in PRD forms


anjha0049;237176 Wrote:
> Hi Folks,
>
> I am trying to call JQuery Script on "onChange" Event of a Particular
> Field(DataType: String, Control:Text) on My PRD Form.
> Steps I have Followed:-
> 1) Introduced JQuery Libraries viz.jquery 1.3.2.min.js and
> jquery-ui-1.7.2.custom.min.js to my local environmeent (Scripts Tab:-
> Script name, External & Path of Libraries).
> 2) On clicking the URL, able to Retrieve Library file Contents on
> ECMAScript Panel screen.
> 3) created a Jquery Script and made it an inline Type of Script.
> 4) Trying to call The Inline script on "onChange" Event of a Text
> field.
>
> Unable to introduce.:(
>
> Please Help In this Regard.
> Any Example, Reference/Document for the same will be highly
> Appreciated.:)
>
> Regards,
> Anand

What error did you get? (See browser console.) You do everything right.


--
hello_amigo
------------------------------------------------------------------------
hello_amigo's Profile: https://forums.netiq.com/member.php?userid=211
View this thread: https://forums.netiq.com/showthread.php?t=49265

0 Likes
Anonymous_User Absent Member.
Absent Member.

Re: JQuery Implementation in PRD forms


Hi amigo,

The problem i am facing is unable to hide or display any field available
on form.
My code is like this(inline Script):-
$(document).ready(function() {
$("#AccessTag").hide();
$("RequestTag").show();
});

where as AccessTag and RequestTag are two label names with Controls
(String,Text) on Form.
1) As selecting the request form, i am using inline script so
logically,the actions should be taken onload of that form.(That is not
Happening & no error either at browser/designer end).
2) Tried to call, Jquery Script From a function, able to call the alert
on entry, but just clicking ok and landing on UserApp form getting error
as "'$' reference is undefined".

I am just in confusion, what else required to be done.Please help(any
step wise documentation to implement a simple Jquery test will work a
lot.)

Thanks in advance.

Regards,
Anand


--
anjha0049
------------------------------------------------------------------------
anjha0049's Profile: https://forums.netiq.com/member.php?userid=5837
View this thread: https://forums.netiq.com/showthread.php?t=49265

0 Likes
Anonymous_User Absent Member.
Absent Member.

Re: JQuery Implementation in PRD forms


anjha0049;237229 Wrote:
>
> The problem i am facing is unable to hide or display any field available
> on form.
>

Why don't you use build-in functions form.hide(fieldname) or
field.hide()?
anjha0049;237229 Wrote:
>
> 2) Tried to call, Jquery Script From a function, able to call the alert
> on entry, but just clicking ok and landing on UserApp form getting error
> as "'$' reference is undefined".
>

Make sure one more time that jquery script is available from the form.
As a temporary solution try to use existing jquery library that is
located inside the idm.war. For that purpose add external script with
"URL/Inline script" : "./javascript/jQuery/scripts/jquery-1.4.2.min.js"


--
hello_amigo
------------------------------------------------------------------------
hello_amigo's Profile: https://forums.netiq.com/member.php?userid=211
View this thread: https://forums.netiq.com/showthread.php?t=49265

0 Likes
Anonymous_User Absent Member.
Absent Member.

Re: JQuery Implementation in PRD forms


Hi amigo,

Just a quick question, as in normal scenario of jquery.If we need to
call a jquery on button click.
The script goes something like:-
$("#button").click(function(){
$("#Access").hide();
});
And so on, Point to be noted that "#button" & "#Access" are two
different ids that i am calling to exceute the action.
Similarly, if i need to call any other type of jquery on any event of a
field. How we should access here in Novell IDM Form Script.
Is it possible to call jquery on event of any field action? If yes,
kindly share some experience/documents for your approach.
Should we call Label name/Display name/ what? as an id to associate
action with it.Any example Please(Most welcome 🙂 ) 🙂

The javascript form.show() & form.hide() you explained in your reply in
absolutely fine. But, if i say you the reality, i have various other
plans with jquery here.
Viz. multiple links on single form (opening a child window on each
click, entering value on each form, persistance of values on each form
in backend & submit in bulk).

So, any idea in this concern is also welcome. At present, Kindly help me
out in previous secenario.

Regards,
Anand


--
anjha0049
------------------------------------------------------------------------
anjha0049's Profile: https://forums.netiq.com/member.php?userid=5837
View this thread: https://forums.netiq.com/showthread.php?t=49265

0 Likes
Anonymous_User Absent Member.
Absent Member.

Re: JQuery Implementation in PRD forms


anjha0049;237243 Wrote:
>
> Should we call Label name/Display name/ what? as an id to associate
> action with it.Any example Please(Most welcome 🙂 ) 🙂
>

If you look at the HTML of a text control (via firebug, for example) you
can see the HTML like this (display label is "source"):


<tr>
<td><img border="0" height="12" width="1" alt=""
src="/idm/resource/portal-general/images/spacer.gif"></td>

<script>JUICE.UICtrlIDMUtil.loadControl("controls/WFControls.js","JUICE.TextCtrl");</script>
<td align="" valign="" nowrap="" style="" class="">
<div id="source_lbl" class="nv-formFieldLabel " style="display:
inline;"><label for="_source" style="">source:</label></div>
</td>
<td align="" valign="" style="">
<input type="hidden" data-type="string" required="false"
editable="true" value="" id="__source" name="value(source)"
errorstatus="-1"><input type="text" onkeypress="return
_noSubmitOnEnterUIForm(event)" class="nv-fontExtraSmall"
style="width:200; display: inline; " size="40" value="" id="_source"
name="_source">
</td>
</tr>

As you can see there is no id with the exact Display name you specified.
But you can use "input" element with id = "__" + your_display_name.
Using that id you can hide/show the item by jQuery like this:

Code:
--------------------

$("#__" + fieldName).parent().parent().hide();
$("#__" + fieldName).parent().parent().show();

--------------------

anjha0049;237243 Wrote:
>
> kindly share some experience/documents for your approach.
>

I attached the PRD with example of using jQuery in forms.
Good luck!


+----------------------------------------------------------------------+
|Filename: TestJqueryPRD.zip |
|Download: https://forums.netiq.com/attachment.php?attachmentid=103 |
+----------------------------------------------------------------------+

--
hello_amigo
------------------------------------------------------------------------
hello_amigo's Profile: https://forums.netiq.com/member.php?userid=211
View this thread: https://forums.netiq.com/showthread.php?t=49265

0 Likes
Anonymous_User Absent Member.
Absent Member.

Re: JQuery Implementation in PRD forms


WOW Amigo!!!:):)
Thanks a lot man..:)

I will take it forward.thanks once more..:)

Regards,
Anand


--
anjha0049
------------------------------------------------------------------------
anjha0049's Profile: https://forums.netiq.com/member.php?userid=5837
View this thread: https://forums.netiq.com/showthread.php?t=49265

0 Likes
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.