Velocity Reviews

Velocity Reviews (http://www.velocityreviews.com/forums/index.php)
-   ASP .Net (http://www.velocityreviews.com/forums/f29-asp-net.html)
-   -   onclick event in FF doesn't work... (http://www.velocityreviews.com/forums/t689217-onclick-event-in-ff-doesnt-work.html)

Misliplavo 06-26-2009 09:07 AM

onclick event in FF doesn't work...
 
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...

Misliplavo 06-26-2009 09:25 AM

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 ?!

Misliplavo 06-26-2009 10:36 AM

I have solved a problem...

Instead of the LinkButton I have set the Button ...


All times are GMT. The time now is 05:59 AM.

Powered by vBulletin®. Copyright ©2000 - 2014, vBulletin Solutions, Inc.
SEO by vBSEO ©2010, Crawlability, Inc.