BEFORE CHAOS
I used to have this one...
at the head part
<script type="text/javascript">$(function() { $("form.openid:eq(0)").openid(); });</script>
in the jquery.openid.js
var direct = function () {
var $li = $(this);
$this.unbind('submit').submit(function() {
$id.val($this.find("li.highlight span").text());
});
$this.submit();
return false;
};
and in the body part
<form class="openid" method="post" action="/Login.xhtml?ReturnUrl=">
<div>
<ul class="providers">
<li class="direct" title="Google"> <img src="images/googleW.png" alt="icon" />
</ul>
</div>
</form>
which works like a charm.
AFTER CHAOS
Now since i would like to add the all above as content in an ASP.NET page i made the appropriate changes
at the head part in The MasterPage
<script type="text/javascript">$(function () { $("#test.openidd").openid(); });</script>
in the body part, i added the div with id=test and class equal to openidd.
<div id ="test" class="openidd">
<ul class="providers">
<li class="direct" title="Google"> <img src="images/google.png" />
</ul>
</div>
So what changes should i make to the jquery.openid.js to make it work?
I mean in the first case the $this refers to form.openid:eq(0)
In the second case the $this refers to #text.openidd and the form is never submitted.
I guess something like this one $this.FindParentForm exists in JQUERY, but i have no clue!
Please keep your answers as simple as possible, since i am a newbie
Thank you in advance.
UPDATE
From the answers i have seen so far, i guess or i have not set my question clear or i am soooo newbie. I added the div tag as enclosure for the elements. The form contains other <li>'s etc that jquery messes with. And i would not like that! That's why in my post i believe that the work has to be done in the jquery.openid.js file... something like
$this.GETParentFORM.unbind('submit').submit(function() {
$id.val($this.GETParentFORM.find("li.highlight span").text());
});
$this.GETParentFORM.submit();