onclick event in FF doesn't work...

Joined
Jun 26, 2009
Messages
4
Reaction score
0
Hi all
I have a problem with FF and javascript...
onclick event just wont fire...
Should I say that it works in IE...

Code behind :

string javaScriptEvent = string.Empty;
javaScriptEvent = string.Format("javascript:ChangeMessage({0});", this.hdnMessageStatus.ClientID);
this.txtNewClubName.Attributes.Add("onblur", javaScriptEvent);
// The first one works... (?!)

javaScriptEvent = string.Format("javascript:return ValidateAddClub({0});", this.hdnValidationStatus.ClientID); // CllientID, UniqueID...
this.lbtnAdd.Attributes.Add("onclick", javaScriptEvent);
// This one doesn't...

Javascript :

function ChangeMessage(element) {
element.value = 1 - element.value;
__doPostBack(element.id, '');
}

function ValidateAddClub(element) {
alert(element);
if (element.value == "Free") {
return true;
}
return false;
}

HTML : (page source)

<div class="submiter">
<a onclick="javascript:return ValidateAddClub(ctl00_cphPage_hdnValidationStatus) ;" id="ctl00_cphPage_lbtnAdd" class="roll" href="javascript:__doPostBack('ctl00$cphPage$lbtnA dd','')">ADD CLUB</a>
</div>

I would appreciate if someone could help me...
 
Joined
Jun 26, 2009
Messages
4
Reaction score
0
Additional :

I have checked in FireBug

If I set this.hdnValidationStatus.ClientID it can not find control (first func still works)
but if I set this.hdnValidationStatus.UniqueID there is no error at all, just don't fire onclick event ?!
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,755
Messages
2,569,536
Members
45,011
Latest member
AjaUqq1950

Latest Threads

Top