JQuery :: Selectors - Create A Sort Of Alias For Variable?

Feb 4, 2011

In my jquery functions, I have many references like this: $("[id$=DDL_DOB_Day]"). I use this format as it works with master pages. The question I have is can i create a sort of alias for this variable so my code is not full of longwinded names? For instance:

dd = $("[id$=DDL_DOB_Day]");
if(dd == 1)

View 5 Replies


Similar Messages:

JQuery :: Use Selectors Rather Than Using A Loop

Nov 24, 2010

Ok heres the scenario: I have a table with many rows in it. Each row has a checkbox in one cell, and a span in another cell. What I want to do in my jquery is to go through the table and find each row where the checkbox is checked, and then store the value of the span in an array. I thought you might be able to do it as a selector rather than using a loop. I tried this but it didn't work

$('.cbox').is(':checked').parent().parent().children('.id-text').val();
$('res-table').find('tr')

It doesn't look very much like it would work though, and funnily enough it didn't So can I do this without using a loop?

View 2 Replies

Use Jquery Selectors On Json Result?

Oct 24, 2010

I'm creating an inbox system for my website which allows basic communication between users. I'm fetching the results with jquery calling a webservice. Then I'm using a jquery template engine to render the results to the screen. So far this all works good. but now I want to add some click functions on certain parts of inbox messages. For example I want the title of the message to be clickable so it will expand/collapse the fulltext which is hidden in a div beneath it.

But I can't seem to use the jquery selectors on this dynamic json result. It works when I put the function in the href tag itself but I don't really want to. I also tried adding the function after the success function but no luck either. Is it possible at all to use selectors with a template engine? I hope I made myself clear otherwise feel free to ask more information.

View 3 Replies

String Concatenation Inside Jquery Selectors

Feb 4, 2010

I am developing a application in C#, ASP.NET and I have a lot os divs in my page, each div is a container for a chat message and each div have a unique id: like this

"<div id='" + myMsgs[j].id_chat_message + "' style='padding: 10px;'>"

so, each div have the same id in page and in database. now a want to find some div, with jquery, but it doesnt work

for (var j = 0; j < myMsgs.length; j++) {
findDiv = $('#<%= ' + myMsgs[j].id_chat_message + '.ClientID%>');
}

i know that my problem is the concatenation of the strings, but i dont know how to solve it.

View 3 Replies

Dynamic Form Generation And JQuery Selectors

Jan 5, 2012

I have a form that is dynamically created from a database, that enables or disables appropriate controls in a repeater.

This is all working fine, but it also needs branching. IE selecting a certain value for a certain field may make another field appear on screen.

I am not doing the database for this so im limited with chnages I can make on that side of things.

Basically im passed a table that looks like this: (Ive stripped out the irelevance)

qid
InitialStateVisible
QuestionIDChangeState
ChangeStateOption
ChangeStateID

[Code]...

basically I need to find the radiobutton list, check its selected value matches the equals then show the div.

Firstly I cannot get the jQuery right to get the selected value and secondly is this a good way of doing things?

View 1 Replies

Filtering Large CSS Files For The Only Required Selectors On A Page - Creating Css Files That Contain Selectors?

Aug 9, 2010

Is there a way of filtering large CSS files for the only required selectors on a page, and creating css files that contain just these selectors?

Case: I have a very large CSS file that I want to filter on a per page basis, so that the file size is cut down and can be cached by mobile devices. I was thinking along the lines of something like a server side dust me selectors tool.The particular project I am working on is using ASP.NET MVC.

View 1 Replies

Multiple Jquery Selectors - Apply The Effect On The Div For Every ImageButton Click

Mar 12, 2011

i am able to click on the ImageButton and apply the Jquery highlight effect to a different div

$("#btnFavorite").click(function() {
// selector for element to highlight
$("#theDiv").effect("highlight", {}, 3000);
});

Now i would like to extend the question as follows. I add the ImageButtons to the webpage dynamically, and i would like to apply the effect on the div for every ImageButton click.

<asp:ListView ID="ListView1" runat="server">
<layouttemplate>
<asp:PlaceHolder id="itemPlaceholder" runat="server" />
</layouttemplate>
<ItemTemplate>
<asp:ImageButton ID="btnFavorite" runat="server" ImageUrl="~/Images/Favorite.png"/>
</ItemTemplate>
</asp:ListView>

What should i do in that case? By using ItemDataBound of the listview and adding attributes like btnFavorite.Attributes.Add("onmouseclick", "doSomething") or what?

View 5 Replies

VS 2008 Why JQuery Selectors Are Failing Inside Validation Method For Chrome/Safari

Mar 15, 2011

I have a CustomValidator client script method that checks the value of a <input type="date" id="start"/> control. I'm accessing the date value using jQuery $('#start').val(), which works fine in Firefox and Opera. When I test in Chrome/Safari, the js console says that $('#start') is null. There is no problem using $('#start') outside the CustomValidator client method in Chrome/Safari. There is also no problem accessing the #start date object via document.getElementById('start') inside the validation method.

why jQuery selectors are failing inside this validation method for Chrome/Safari?

View 1 Replies

JQuery :: JQuery Sortable - Sort And Update Database / Using For Custom Sorting <ul><li> List?

Mar 15, 2011

I am using jQuery for custom sorting my <ul><li> list.But I have a problem. I can sort and move those <li>-s but problem is I don't know how to update database with new order integers.Example of html ul li:

[Code]....

This is an example of my li element.. I have id=43, thats Id of picture in database.I use this javascript for trying to somehow make array and read that id into array:

[Code]....

Problem is I don't know exactly what am I doing wrong, because my event doesn't fire, when I press "update button.. Update button fires "update" function on click:

[Code]....

I hope someone will try to explain.Do codebehind and html needs to be in the same document? Can I use ascx and use "update" button there, to fire aspx methode?

View 5 Replies

JQuery :: Grab A Global Variable Or Session Or View State Variable In The Javascript?

Dec 9, 2010

can we grab a global variable or Session or View State variable in the javascript or using jquery?

View 2 Replies

JQuery :: Table Is Containing Date - How To Sort It

Dec 10, 2010

in a table simple text is sort ,but Date, & number is not sort how to sort it using jquery in below code how to sort ID, & M.Date

[Code]....

View 5 Replies

C# - Using Jquery To Sort Gridview Columns At Client Side?

Oct 27, 2010

How can I using JQuery sort any column of gridview at client side?

View 2 Replies

SQL Server :: Using Alias Right In Select Statement?

Feb 24, 2011

here is a sql select statement,

Select
ColA = ID
,ColB = Name
,ColC = invtotamt + (SELECT SUM(TableA.camount) FROM TableA WHERE TableA.csucceed = 1 AND TableA.cID = InventoryTotal.invID GROUP BY TableA.cID)
,ColD = ((SELECT SUM(TableA.camount) FROM TableA WHERE TableA.csucceed = 1 AND TableA.cID = InventoryTotal.invID GROUP BY TableA.cID)
,ColE = (SELECT SUM(TableB.camount) FROM TableB WHERE TableB.csucceed = 1 AND TableB.cID = InventoryTotal.invID GROUP BY TableB.cID)
FROM TABLE

it look complicated, and long statement, actually it's easy, it is like: (it's a sample, not a really one)

Select
ColA = ID
,ColB = Name
,ColC = ColD + ColE
,ColD = ColE + ColC
,ColE = ColC + ColD/100
FROM TABLE

it looks much easier with ALIAS. But, it seems i cannot directly use alias in select stetement like that.
if i cannot use alise, i have to copy paste lots of same column definition. how can i use the alias in select statement?? this bothers me a lots of times!

View 5 Replies

SQL Query Error In Defining Alias For Column

Sep 4, 2010

My following sql query giving me the following error, What does it mean. Am i defining the alias fir column in wring way. Please help me out with this. My error is this and i am putting query just below the error. Error in SELECT clause: expression near 'Year'. Missing FROM clause. Unable to parse query text.

SELECT [tbl_students].passing_year as Passing Year,[tbl_branch].branch_name as Branch_Name FROM [tbl_students], [tbl_course], [tbl_branch] WHERE [tbl_students].course_id=@courseId
AND [tbl_students].branch_id IN(64)
AND [tbl_students].course_id=[tbl_course].course_id AND [tbl_students].branch_id=[tbl_branch].branch_id
AND (@firstYrPercent is null OR [tbl_students].first_year_percent>=@firstYrPercent)
AND (@secondYrpercent is null OR [tbl_students].second_year_percent>=@secondYrPercent)
AND (@thirdYrPercent is null OR[tbl_students].third_year_percent>=@thirdYrPercent)
AND (@finalYearpercent is null OR [tbl_students].final_year_percent>=@finalYearpercent)
AND (@currentDegeePercentage is null OR [tbl_students].current_degree_percent>=@currentDegeePercentage)
AND (@passoutYear is null OR [tbl_students].passing_year>=@passoutYear)
AND (@currentBacklog is null OR [tbl_students].current_backlog=@currentBacklog)
AND (@sex is null OR [tbl_students].gender=@sex)
AND (@eGap is null OR [tbl_students].gapin_education<=@eGap)
AND (@highSchoolPercentge is null OR [tbl_students].highschool_percentage>=@highSchoolPercentge)
AND (@higherSchoolPercentage is null OR [tbl_students].ssc_percentage>=@higherSchoolPercentage)
AND (@grauationPercentage is null OR [tbl_students].graduation_percentage>=@grauationPercentage)
AND (@diplomaPercentage is null OR [tbl_students].diploma_percentage>=@diplomaPercentage)
AND (@noOfAtkt is null OR [tbl_students].number_of_ATKT<=@noOfAtkt)
AND (@validDate is null OR [tbl_students].DOB>=@validDate)

View 1 Replies

CSS Selectors In Web Forms

Nov 26, 2010

I have a web forms app with a CSS file for layout. One of my elements, which will be much more difficult to do in CSS without using IDs, also has to have runat="server" since I control visibility server side.

<div id="x">
<div id="whatever" runat="server" visible="false">
<div id="y">
....
</div>
</div>
</div>

My problem is that in the CSS, I don't know how to ignore that whatever div with my selectors, and unless I inline the CSS and put in server to client control translation, I won't know the control names until runtime.

#x
{
position:absolute;
height:30px;
}
#x #whatever??? #y img
{
margin:-7px 15px 0 30px;
}
#x #whatever??? div
{
width:250px;
float:left;
}

How should I work around this? Is there a server side container control that doesn't render output but could be used to contol the visibility/rendering of its contents, or is there a trick in CSS to ignore that intermediate div? This is additionally confused by the fact I have the x div in a master page and the whatever and y divs are both in the page itself. I know this wouldn't be an issue if I were using MVC, but at this point switching is not an option.

View 2 Replies

Databases :: Fetch The Data From A Table With Alias Name In Oracle?

Aug 11, 2010

I need to fetch the data from a table with Alias name in oracle.

example: select f1 'Field Name1',f2 'Field Name2' from sometablename;

View 2 Replies

DataSource Controls :: Include An Alias In Select Query?

Jun 22, 2010

I have an application that I am developing using ASP.Net with visual basic code. I have a table called "Customers" that contains 3 fields. The name of each field is "Name", "LocationA", and "LocationB". I want to code a select query that list two columns. The first column should contain the field "Name". I want the second column to contain the value in the field "LocationB" if "LocationB" is not null, else I want the second column to contain the value in the field "LocationA".

View 4 Replies

Forms Data Controls :: How To Change Sort Column Header Text And Retain The Sort Link

Jun 3, 2010

I have a simple dynamic gridview with following code -

GV = new GridView();

View 3 Replies

Web Forms :: DataView.Sort Vs List.sort?

Mar 7, 2010

Actually i want to ask which is the best for sorting in Asp.Net is it DataView.Sort Method or List<Object>.Sort() method.

View 1 Replies

Web Forms :: Sort Datatable Without DefaultView.Sort?

Apr 20, 2010

I'm looking for a way to sort the rows of a datatable without setting the DefaultView.Sort to a specific column. I have a datatable in session that users can add records to. I want them to be able to sort the data by clicking on a button. But new records added after that need to show up at the bottom of the list until the sort button is clicked again.

View 2 Replies

Get Session Variable With JQuery?

Nov 16, 2010

I have a function :

$("#LBAvailable").click(function () {
var str = $("#UserName").val();[code]....

But i cannot get the session variable "lang" -> var sess = '<%=Session["lang"]%>'; How can i pass this variable? What is the syntax?

View 2 Replies

JQuery :: Use Jquery To Create A Play/pause Button To Auto Page Through The Listview Control?

Dec 10, 2010

I'm finding it next to impossible setting up a slideshow given the constraints I have. I could do it easily using a listview control except listview controls don't automatically page themselves! Is it possible to use jquery to create a play/pause button to auto page through the listview control, making it a slide show?

View 1 Replies

Forms Data Controls :: Gridview Sort Expression - How To Reset A Gridview Or Prevent It From Doing A Sort

Sep 23, 2010

Just spent about 8 hours googling and looking through this forum for a solution on how to make sure that I can dynamically sort. Here is the situation.

I have 1 Gridview that displays 10 different scenarios based on what button is clicked.

I am also returning only top 10 records. I am doing all of the data binding pragmatically. So I have BoundFields, HyperLinkFields etc.

I also want to sort some records. When I change DataSource SQL statement the gridview somehow remembers what the last sort value was and it errors out saying that value "x" cannot be sorted because it does not exists.

I tried this:

Tried setting gridview1.sqldatasourceid = null; gridview1.allowsorting = false; gridview1.databind();

Here I get an error that says that the data source does not support sorting? Doesnt it say gridview1.allowsorting = false;

I also tried gridview1.sort("", SortDirection.Ascending); This does nothin... except query my database one more time because i have a onSorting event that looks like this:

[Code]....

Here is an example of just one of those SLQ statements inside GetSQLQuery:

[Code]....

View 1 Replies

JQuery :: Create Twitter Like Registration Form For An (C#) Web Application With JQUERY?

Jul 23, 2010

I want to create a twitter like user registartion form for my asp.net(C#) web application. I have configured asp.net membership module for my site. I have searched alot but couldn't find any all in one JQuery Plugin which provide the following functionalities to my webform

1. Form Feild highlight when onFocus and on error
2. Tooltip when form feild is in focus
3. Proper client-side form valodation
4. Check user name avalibility
5. Check email re-registration
6. Calculate Password strength
7. Nice feedback when form is submitted

Can anyone know any all in one plugin wich I can add to my asp.net(C#) registration forms to make my forms live? I'm extremly new to jquery and it my firstever jquery project.

View 4 Replies

Jquery - Create QUnit Test That Will First Create Mouseover And Then Show An Alert

Feb 28, 2011

I have asp.net button and I want to create a QUnit test that will first create mouseover and then show an alert. How to do this. I tried

test("mouseover",function(){
$("#buttonid").mouseover(function () {
alert('mouseover');
test(true,"Done");
});
});

but it doesnt work.

View 1 Replies







Copyrights 2005-15 www.BigResource.com, All rights reserved