Search Results

Search found 71 results on 3 pages for 'moayad abu jaber'.

Page 2/3 | < Previous Page | 1 2 3  | Next Page >

  • jquery form validation: validation script specified externally

    - by Abu Hamzah
    i have a jquery form validation in the master page and it works fine and i got that working from this article: http://www.dotnetcurry.com/ShowArticle.aspx?ID=310 my question is: if i place the .js to external and add a reference to my page then its not working... it says object expected here is how i have done: in my content page (i am using master page, asp.net ) add in my content page: <script src="myform_validation.js" type="text/javascript"></script> <script type="text/javascript"> $(document).ready(function() { ValidateMe(this); }); </script> below is in the external .js file: function ValidateMe() { $("#aspnetForm").validate({ rules: { <%=TextBox1.UniqueID %>: { maxlength:1, //minlength: 12, required: true }, <%=TextBox2.UniqueID %>: { minlength: 12, required: true }, <%=TextBox3.UniqueID %>: { minlength: 12, required: true }//, // }, messages: { <%=TextBox1.UniqueID %>: { required: "Enter your firstname", minlength: jQuery.format("Enter at least {0} characters") }, <%=TextBox2.UniqueID %>: { required: "Please enter a valid email address", minlength: "Please enter a valid email address" } , <%=TextBox3.UniqueID %>: { required: "Enter your firstname", minlength: jQuery.format("Enter at least {0} characters") } } , success: function(label) { // set &nbsp; as text for IE label.html("&nbsp;").addClass("checked"); } }); } ;

    Read the article

  • Load Country/State/City

    - by Abu Hamzah
    I have chain of drop down like Country / state and City. Is there is any way to wait until the drop down population then proceed further? like first load the country and then based on the select of an country then load the state and same as city.... function populateLists(listType) { // on success do this:<br> $.ajax({ type:"POST", url:"Wizard_Using_PageMethod.aspx/GetCountry", data: "{}", contentType: "application/json; charset=utf-8", dataType:"json" } }); [WebMethod] public static CountryList GetCountry() { CountryList country = new CountryList(); ///go to db and get the data return country; }

    Read the article

  • Using NHibernate's HQL to make a query with multiple inner joins

    - by Abu Dhabi
    The problem here consists of translating a statement written in LINQ to SQL syntax into the equivalent for NHibernate. The LINQ to SQL code looks like so: var whatevervar = from threads in context.THREADs join threadposts in context.THREADPOSTs on threads.thread_id equals threadposts.thread_id join posts1 in context.POSTs on threadposts.post_id equals posts1.post_id join users in context.USERs on posts1.user_id equals users.user_id orderby posts1.post_time where threads.thread_id == int.Parse(id) select new { threads.thread_topic, posts1.post_time, users.user_display_name, users.user_signature, users.user_avatar, posts1.post_body, posts1.post_topic }; It's essentially trying to grab a list of posts within a given forum thread. The best I've been able to come up with (with the help of the helpful users of this site) for NHibernate is: var whatevervar = session.CreateQuery("select t.Thread_topic, p.Post_time, " + "u.User_display_name, u.User_signature, " + "u.User_avatar, p.Post_body, p.Post_topic " + "from THREADPOST tp " + "inner join tp.Thread_ as t " + "inner join tp.Post_ as p " + "inner join p.User_ as u " + "where tp.Thread_ = :what") .SetParameter<THREAD>("what", threadid) .SetResultTransformer(Transformers.AliasToBean(typeof(MyDTO))) .List<MyDTO>(); But that doesn't parse well, complaining that the aliases for the joined tables are null references. MyDTO is a custom type for the output: public class MyDTO { public string thread_topic { get; set; } public DateTime post_time { get; set; } public string user_display_name { get; set; } public string user_signature { get; set; } public string user_avatar { get; set; } public string post_topic { get; set; } public string post_body { get; set; } } I'm out of ideas, and while doing this by direct SQL query is possible, I'd like to do it properly, without defeating the purpose of using an ORM. Thanks in advance!

    Read the article

  • jquery plugin - autoSuggest

    - by Abu Hamzah
    please help me to choose the best plug-in in my particular scenario, I am building a page where user will enter his/her first or last name initial and it will populate the name and I have around 25k records in my db. what do you guys recommend?

    Read the article

  • Using a custom IList obtained through NHibernate

    - by Abu Dhabi
    Hi.I'm trying to write a web page in .NET, using C# and NHibernate 2.1. The pertinent code looks like this: var whatevervar = session.CreateSQLQuery("select thread_topic, post_time, user_display_name, user_signature, user_avatar, post_topic, post_body from THREAD, [USER], POST, THREADPOST where THREADPOST.thread_id=" + id + " and THREADPOST.thread_id=THREAD.thread_id and [USER].user_id=POST.user_id and POST.post_id=THREADPOST.post_id ORDER BY post_time;").List(); (I have tried to use joins in HQL, but then fell back on this query, due to HQL's unreadability.) The problem is that I'm getting a result that is incompatible with a repeater. When I try this: posts.DataSource = whatevervar.; posts.DataBind(); ...I get this: DataBinding: 'System.Object[]' does not contain a property with the name 'user_avatar'. In an earlier project, I used LINQ to SQL for this same purpose, and it looked like so: var whatevervar = from threads in context.THREADs join threadposts in context.THREADPOSTs on threads.thread_id equals threadposts.thread_id join posts1 in context.POSTs on threadposts.post_id equals posts1.post_id join users in context.USERs on posts1.user_id equals users.user_id orderby posts1.post_time where threads.thread_id == int.Parse(id) select new { threads.thread_topic, posts1.post_time, users.user_display_name, users.user_signature, users.user_avatar, posts1.post_body, posts1.post_topic }; That worked, and now I want to do the same with NHibernate. Unfortunately, I don't know how to make the repeater recognize the fields of the result of the query. Thanks in advance!

    Read the article

  • tableSorter limitation (sort) one page at a time?

    - by Abu Hamzah
    i see that in tableSorter you can sort one page at a time which concerns me. Only 1 page of results can be sorted at a time?, which is pretty limiting. If you have a query result that spans multiple pages, how you will handle this? If anyone knows better, feel free to correct me if iam incorrect Thanks.

    Read the article

  • RegEx for the <li></li> tags

    - by Abu
    Hi All, i am working on the C# WinForm application. In that application, i have snippet like this: <ul> <li>abc <li>bbc <li>xyz <li>pqr </li></li></li></li> </ul> but, i want to get output like.. <ul> <li>abc</li> <li>bbc</li> <li>xyz</li> <li>pqr</li> </ul> Is there any method using which this thing can be done? Can anybody suggest me any RegEx for this problem? Thanks. Regards.

    Read the article

  • JQuery autocomplete: is not working asp.net

    - by Abu Hamzah
    is that something wrong in the below code? its not firing at all edit <%@ Page Language="C#" AutoEventWireup="true" CodeBehind="HostPage.aspx.cs" Inherits="HostPage" %> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head runat="server"> <title>Untitled Page</title> <script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.4/jquery.min.js"></script> <script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jqueryui/1.8/jquery-ui.min.js"></script> <link rel="stylesheet" href="http://dev.jquery.com/view/trunk/plugins/autocomplete/jquery.autocomplete.css" type="text/css" /> <script type="text/javascript" src="http://dev.jquery.com/view/trunk/plugins/autocomplete/jquery.autocomplete.js"></script> </head> <body> <form id="form1" runat="server"> <script type="text/javascript"> $(document).ready(function() { $("#<%=txtHost.UniqueID %>").autocomplete("HostService.asmx/GetHosts", { dataType: 'json' , contentType: "application/json; charset=utf-8" , parse: function(data) { var rows = Array(); debugger for (var i = 0; i < data.length; i++) { rows[i] = { data: data[i], value: data[i].LName, result: data[i].LName }; } return rows; } , formatItem: function(row, i, max) { return data.LName + ", " + data.FName; } }); }); </script> <div> <asp:Label runat="server" ID='Label4' >Host Name:</asp:Label> <asp:TextBox ID="txtHost" runat='server'></asp:TextBox> <p> </div> </form> </body> </html>

    Read the article

  • jquery datepicker: select date as back as 6 months

    - by Abu Hamzah
    Start date: user can select start date as back as 6 months. example: if today is 04/23/2010 then i can go back up to 11/23/2009 but not more than 6 months. <script type="text/javascript"> $(document).ready(function () { $('#endDate').datepicker({ showOn: 'button', buttonImage: '../images/Calendar.png', buttonImageOnly: true, onSelect: function () { }, onClose: function () { $(this).focus(); } }); $('#startDate').datepicker({ showOn: 'button', buttonImage: '../images/Calendar.png', buttonImageOnly: true, onSelect: function (dateText, inst) { $('#endDate').datepicker("option", 'minDate', new Date(dateText)); } , onClose: function () { $(this).focus(); } }); }); update code: var currentDate = new Date(); var currentMonth = currentDate.getMonth() + 1; var sixMonths = currentMonth + 6 currentDate.setMonth(currentDate.currentMonth, sixMonths); var myNewCurrentDate = new Date(currentDate) $('#startDate').datepicker('option', { minDate: myNewCurrentDate }); i am getting currentDate = NaN

    Read the article

  • WCF Service Library Reference in a Web Form (asp.net)

    - by Abu Hamzah
    i am not sure if this is the correct way of doing but i read that you not suppose to have a WCF Service Library reference in your web form project rather you add endpoints to your web.config, is that true? here is what i have done: 1) create a WCF service library project 2) create a simple service called "MyService.svc" WebForm: 1) Create a web project 2) create a WCF Service and in it i have this code <%@ ServiceHost Language="C#" Service="WCFJQuery.ContactBLL.Implementation.ContactUs" Factory="System.ServiceModel.Activation.WebScriptServiceHostFactory" %> 3) right click on the web proejct and "Add Reference" and add teh MyService.dll reference from WCF service library project. is this something how you suppose to do?

    Read the article

  • wcf - jquery - gridview (webform) binding

    - by Abu Hamzah
    i am using WCF to return my data and not sure how sure how i will bind the gridview once i get the data on the clientside? any help? ContactServiceProxy.invoke({ serviceMethod: "Holidays", callback: function(response) { //how to bind gridview here? }, error: function(xhr, errorMsg, thrown) { postErrorAndUnBlockUI(xhr, errorMsg, thrown); } });

    Read the article

  • submitting the form even if the form is in invalid state

    - by Abu Hamzah
    i am using asp.net web forms and i am using bassistance.de jquery validation.. i have bunch of fields in the form and its validatating how it suppose to but its still executing my code behind code, why is it doing that? here is my code: form: <script type="text/javascript"> $(document).ready(function() { $("#aspnetForm").validate({ rules: { <%=txtVisitName.UniqueID %>: { maxlength:1, //minlength: 12, required: true } ................. }, messages: { <%=txtVisitName.UniqueID %>: { required: "Enter visit name", minlength: jQuery.format("Enter at least {0} characters.") } ............ }, success: function(label) { label.html("&nbsp;").addClass("checked"); } }); $("#aspnetForm").validate(); }); </script> <div > <h1> Page</h1> <asp:Label runat="server" ID='Label1'>Visit Name:</asp:Label> <asp:TextBox ID="txtVisitName" runat='server'></asp:TextBox> ............ ............... <button id="btnSubmit" name="btnSubmit" type="submit"> Submit</button> </div> and i have a external .js file referencing to my web form page. $(document).ready(function() { $("#btnSubmit").click(function() { SavePage(); }); }); i have a WebMethod .cs and i have bookmark and it does hitting that line of code even thoug my page is in invalid state. how would i fix this? thanks.

    Read the article

  • jQuery Validation in ASP.NET

    - by Abu Hamzah
    i have a strange situation may its a easy fix or something i may be missing but here is the question. i have a asp.net form with master page and my validation works great without any problem but the problems starts when i try to hook my click event to the server side, here is what i meant: i have a form with few fields on it and if the form is empty than it should STOP submitting, otherwise allow me to execute the server side script but its not happening, even my form is in invalid state (i do get error message saying i have to enter the required fileds) but still executing my server side script. i would like to execute my server side script only if the form is in valid state. here is my code: my master page <%@ Master Language="C#" AutoEventWireup="true" CodeFile="MasterPage.master.cs" Inherits="MasterPage" %> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head runat="server"> <title>jQuery Validation in ASP.NET Master Page</title> <script src="Scripts/jquery-1.3.2.js" type="text/javascript"></script> <script src="Scripts/jquery-1.3.2-vsdoc2.js" type="text/javascript"></script> <script src="Scripts/jquery.validate.js" type="text/javascript"></script> <asp:ContentPlaceHolder id="head" runat="server"> </asp:ContentPlaceHolder> </head> <body> <form id="form1" runat="server"> <div> <asp:ContentPlaceHolder id="ContentPlaceHolder1" runat="server"> </asp:ContentPlaceHolder> </div> </form> </body> </html> my content page: <%@ Page Title="" Language="C#" MasterPageFile="~/MasterPage.master" AutoEventWireup="true" CodeFile="Default.aspx.cs" Inherits="_Default" %> <asp:Content ID="Content1" ContentPlaceHolderID="head" Runat="Server"> </asp:Content> <asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" Runat="Server"> <script type="text/javascript"> $(document).ready(function() { $("#aspnetForm").validate({ rules: { <%=txtName.UniqueID %>: { minlength: 2, required: true }, <%=txtEmail.UniqueID %>: { required: true, email:true } }, messages: { <%=txtName.UniqueID %>:{ required: "* Required Field *", minlength: "* Please enter atleast 2 characters *" } } }); }); </script> Name: <asp:TextBox ID="txtName" MaxLength="30" runat="server" /><br /> Email: <asp:TextBox ID="txtEmail" runat="server"></asp:TextBox><br /> <asp:Button ID="btnSubmit" runat="server" onclick="SubmitTheForm();" Text="Submit" /> </asp:Content> function SubmitTheForm() { SaveTheForm(); } function SaveTheForm() { debugger; var request = buildNewContactRequest(); ContactServiceProxy.invoke({ serviceMethod: "PostNewContact", data: { request: request }, callback: function(response) { processCompletedContactStore(response); }, error: function(xhr, errorMsg, thrown) { postErrorAndUnBlockUI(xhr, errorMsg, thrown); } }); return false; }

    Read the article

  • limit number of characters entered in textarea

    - by Abu Hamzah
    here is the script does what i want but not exactly, my question is, how can i stop user entering text once it reached the lmit of 255 characters? var limit = 255; var txt = $('textarea[id$=txtPurpose]'); $(txt).keyup(function() { var len = $(this).val().length; if (len > limit) { //this.value = this.value.substring(0, 50); $(this).addClass('goRed'); $('#spn').text(len - limit + " characters exceeded"); return false; } else { $(this).removeClass('goRed'); $('#spn').text(limit - len + " characters left"); } }); if there is a better way please let me know.

    Read the article

  • jquery autosuggest: what is wrong with this code?

    - by Abu Hamzah
    i have been struggling to make it work my autosugest/autocomplete and its acting strange unless i am doing completely silly here. please have a look 1) does not do anything, does not work or nor fire the event. <script src="Scripts/jquery-1.4.2.js" type="text/javascript"></script> <script src="Scripts/jquery.autocomplete.js" type="text/javascript"></script> <form id="form1" runat="server"> <script type="text/javascript"> $(document).ready(function() { $("#<%=txtHost.UniqueID %>").autocomplete("HostService.asmx/GetHosts", { dataType: 'json' , contentType: "application/json; charset=utf-8" , parse: function(data) { var rows = Array(); debugger for (var i = 0; i < data.length; i++) { rows[i] = { data: data[i], value: data[i].LName, result: data[i].LName }; } return rows; } , formatItem: function(row, i, max) { return data.LName + ", " + data.FName; } }); }); </script> 2) this works if i remove the above code and replace with this code: <script type="text/javascript"> $(document).ready(function() { $("#txtHost").autocomplete("lazy blazy crazy daisy maisy ugh".split(" ")); }); </script> any help ?

    Read the article

  • jquery datepicker in asp.net

    - by Abu Hamzah
    whats wrong with the below code, its throwing me an error of Compiler Error Message: CS1002: ; expected $(document).ready(function() { $('<%StartDate%>').datepicker({ showOn: 'button', buttonImage: '../images/Calendar.png', buttonImageOnly: true, onSelect: function() { }, onClose: function() { $(this).focus(); } }); }); <label for="sd">StartDate:</label> <asp:TextBox ID="StartDate" runat="server"></asp:TextBox>

    Read the article

  • submittingthe form even if the form is in invalid state

    - by Abu Hamzah
    i am using asp.net web forms and i am using bassistance.de jquery validation.. i have bunch of fields in the form and its validatating how it suppose to but its still executing my code behind code, why is it doing that? here is my code: form: <script type="text/javascript"> $(document).ready(function() { $("#aspnetForm").validate({ rules: { <%=txtVisitName.UniqueID %>: { maxlength:1, //minlength: 12, required: true } ................. }, messages: { <%=txtVisitName.UniqueID %>: { required: "Enter visit name", minlength: jQuery.format("Enter at least {0} characters.") } ............ }, success: function(label) { label.html("&nbsp;").addClass("checked"); } }); $("#aspnetForm").validate(); }); </script> <div > <h1> Page</h1> <asp:Label runat="server" ID='Label1'>Visit Name:</asp:Label> <asp:TextBox ID="txtVisitName" runat='server'></asp:TextBox> ............ ............... <button id="btnSubmit" name="btnSubmit" type="submit"> Submit</button> </div> and i have a external .js file referencing to my web form page. $(document).ready(function() { $("#btnSubmit").click(function() { SavePage(); }); }); i have a WebMethod .cs and i have bookmark and it does hitting that line of code even thoug my page is in invalid state. how would i fix this? thanks.

    Read the article

  • jquery autosuggest not firing (webform)

    - by Abu Hamzah
    is that something wrong in the below code? its not firing at all $(document).ready(function() { $("#<%=txtHost.ClientID%>").autocomplete("HostService.asmx/GetHosts",{ dataType: 'json' ,contentType: "application/json; charset=utf-8" ,parse: function(data){ var rows = Array(); debugger for(var i = 0; i<data.length; i++){ rows[i] = {data:data[i], value:data[i].LName, result:data[i].LName}; } return rows; } ,formatItem: function(row, i, max){ return data.LName + ", " + data.FName; } }); }); <script src="Scripts/jquery.autocomplete.js" type="text/javascript"></script> <asp:TextBox ID="txtHost" runat='server'></asp:TextBox>

    Read the article

  • onchange on dropdownlist

    - by Abu Hamzah
    my qeustion is continuation of what i have asked see the link. http://stackoverflow.com/questions/2640001/load-country-state-city i have expand to load my drop downs list from db and i just need a way to wire onchange method in my first dropdownlist and second, please see the code. appreciate any help. $(document).ready(function() { var options = { type: "POST", url: "SearchPage.aspx/LoadCountry", data: "{}", contentType: "application/json; charset=utf-8", dataType: "json", success: function(msg) { var returnedArray = msg.d; list = $("#country"); for (var i = 0; i { list.append("" + returnedArray[i].Name + ""); } error : function(msg) { debugger } } }; $.ajax(options); }); how would i do for STATE dropdownlist ?

    Read the article

  • how to organize all JQuery scripts

    - by Abu Hamzah
    i am using half dozen jquery plugins and plus my own jquery scripts and in every script i have this code: $(document).ready(function() { .... } what is the best way of organizing all the scripts in one centeralized location and instead of having multiple times $(document).ready(function() everywhere in the script. thoughts?

    Read the article

  • Needs opinions based on design guidelines .

    - by Abu Hamzah
    i am in the process of desigining my domain model and i know its very hard to suggest without knowledge of domain but what i am asking is how to implement or the best way of implementing the baseclass in my domain model. here are few classes: PartialPerson.cs Facilities.cs Visit.cs EntryPoint.cs etc.... my baseclass looks like this: public abstract class BaseClass { public int InfoId { get; } public int PersonId { get; } } here is what i am confused and need help. how do i implement the above baseclass? in the PartialPerson,Facilities,Visit...

    Read the article

  • Get the value of an attribute Jquery

    - by Abu Hamzah
    i am trying to get EmployeeId withitn the DOM something like this: var o = obj[$(this).attr("EmployeeId")]; but getting undefined when i debug i see the following: $(this)[0].data data "{EmployeeId: 'A42345'}" here is my source code: $.ajax({ type: "POST", url: url, data: "{EmployeeId: '" + id + "'}", contentType: "application/json; charset=utf-8", dataType: "json", success: function (response) { var obj = (typeof response.d) == 'string' ? eval('(' + response.d + ')') : response.d; var o = obj[$(this).attr("EmployeeId")]; //<<<<undefined

    Read the article

< Previous Page | 1 2 3  | Next Page >