I have some javascript code that is being moved from one site to another. In my original site when I am in a page profile.php when I click on an edit button all my form fields are made editable when I click on a Edit text and a two new buttons save and cancel appear.
First the html around the section I am having a problem with
[code]
<form name=”editProfile” id=”editProfile”>
<tr bgcolor=”#E4E9ED” class=”mid”>
<td bgcolor=”#E4E9ED” class=”BOT”><div align=”left”><strong>
<?=$first_name.” “.$last_name?> </strong></div>
</td>
<td align=”right” bgcolor=”#E4E9ED” class=”BOT”><strong> <span class=”mid” id=”editProfLink” style=”cursor:pointer;cursor:hand ; font-weight:bold” onclick=”makeEditableProfile()”>Edit profile</span> <span id=”savingProfile” style=”display:none”>Saving…</span> </strong> <span id=”editProfileBut” style=”display:none”>
<input name=”save” type=”button” onclick=”editProfileProc()” id=”save” value=”Save” class=”mid” />
<input name=”cancel” type=”button” id=”cancel” value=”Cancel” onclick=”makeReadonlyProfile()” class=”mid” />
</span> </td>
</tr>
When I click on Edit profile it calls the javascript makeEditableProfile() show below
[code]
function makeEditableProfile() {
var ob = document.editProfile;
for (i = 0; i < ob.elements.length; i++) {
if (ob.elements[i].type == “text”) {
ob.elements[i].className = ‘edit’;
ob.elements[i].readOnly = false;
}
}
$(‘editProfLink’).style.display=’none’;
$(‘editProfileBut’).style.display = ”;
}
If I understand correctly this javascript should chang the style editProfileBut to be displayed which will then have it display the buttons.
I’ve verified this is css related by turning off css in firefox and all the various buttons appear. I’m just not sure what is going wrong in the actually site. I am especially wondering what would stop working as I move from one site to another.
Thanks for any help