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