PeopleSoft -- JQuery -- MouseOver

Today, I was trying to hide fields both in level 0 and level 1 scroll in PeopleSoft using JQuery. For Level 0, my test page contains a single edit box and single push button and I tried using the mouseover() event of JQuery to hide the edit box in PeopleSoft.

I inserted a HTML area into the page where the edit box is residing and added some code into it;

<html>
<head>
<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.4.0/jquery.min.js"></script>
<script type="text/javascript">
$(document).ready(function(){
$("#TEST_REC_FIELD1").mouseover(function(){
$("#TEST_REC_FIELD1").hide();
});
});
</script>
</head>
<body>
</body>
</html>

Simple, isn't it? When I tried a mouseover event on the test field (TEST_REC_FIELD1), I was able to hide it quite comfortably. Now, I added a grid into the page and tried to hide fields in level 1 scroll. The grid contains a single field, and my aim is to hide this column in level 1 on mouse over.The grid ID contains a '$' symbol and we need to escape it in this case. The HTML is provided below

<html>
<head>
<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.4.0/jquery.min.js"></script>
<script type="text/javascript">
$(document).ready(function(){
$("#RE_LEVEL0_TMP_CAPTURE_ID\\$0").mouseover(function(){
$("#RE_LEVEL0_TMP_CAPTURE_ID\\$0").hide();
});
});
</script>
</head>
<body>

Note that, if it is not escaped, we will not be able to hide it and the mouseover event will not get triggered in PeopleSoft :). When this piece of code was tried, I was able to hide the field on level 1 during a MouseOver event.

2 comments:

  1. Nice, but you shouldn't really have the html, head or body tags in there. The HTML is inserted in the middle of a document that already has those elements.

    ReplyDelete
  2. Can we get value of field using .val() function?

    ReplyDelete