Saturday, 17 August 2013

2 jquery wired problems with jquery valid and show functions

2 jquery wired problems with jquery valid and show functions

Hi i am using MVC 4 project and getting through two weird problems.
i am using a treeview
Admin Panel
@Html.ActionLink("Admin Preference", "Index", "AdminPreferences")/span>
Platform
@Html.ActionLink("Platform Details", "Index", "PlatformDetail")
Now Admin Panel li is not showing be default. But when i wanted to show
this panel its not working.Code i am using is
var adminPanel = $("#adminpanel");
if (SiteMaster.UserIsAdmin == "True") {
adminPanel.show();
adminPanel.css("display", "block");
}
Now it is going inside this if condition but it doesn't show.
Second problem is with jquery valid function.
I have html html button
<input type="submit" id="frmSave" name="Command" value="Save" />
in ready function first i am using
$("#formid").validationEngine();
to jquery validation to fire and on button click
$('#frmSave').click(function () {
if ($("#formid").valid()) {
alert('the form is valid');
}
});
but this alert is not firing up.. don't know why ?

No comments:

Post a Comment