I am doing the following to toggle the display of an element:
$("*[id^=" + id + "_]").toggle(); // id is the element to toggle
This then toggles everything of the form id_* where * is any string.
I now realized, that I don't want to simply toggle each element, but show or hide it based on the state of the clicked element. How can I ...
This question in summary is to figure out how to pass variables between javascript functions without: returning variables, passing parameters between primary functions, using global variables, and forcing function 1 to wait for function 2 to finish. I figured out a jQuery solution and posted in below (in the answers section).
Old Pos...
I have created a function to showing a title text in a separate div, its wotks perfectly, but a have problems with "title" attribute, so i wonna delete it after tooltipp wenn be displayed. And on mouse ou show it agaiin, but the variable tooltipptext is empty... same one an idea?
var tooltipptext;
$(".infoimg").hover(function(event)...
So we have this:
$.post('testeUpdate.php', 'someValue'
function(dadosResposta) {
$('#ns-nome').val(dadosResposta.nsName);
$('#ns-endereco').val(dadosResposta.nsAddress);
},
"json");
From client to server:
Is sends 'sameValue' to testeUpdate.php using POST.
On success, it receives the data retur...
I'm using jTemplate & jQuery to query a .net Web Method, then display the results in a webpage.
Shown below is the HTML where it all happens, the DIV with the class Template is my template. Then the actual results get put into the DIV with the class Results.
<div id="SharepointDocumentSearch" style="display:none;">
<p>
Docu...
I am trying to run the following code:
I pass parameter to a function, but it always has the value of the last object run through the loop. I read some articles about it on stackoverflow, but I couldn't find out how to make it run in my solution.
The object is a JSON object returned from the server. All it's values are correct.
for(v...
OK, so I want to get a row of data from a DB via jQuery.ajax()
Here is the code where I want to load it:
$.ajax({
url: 'mypage.php?id=345',
success: function(data) {
//process array of data
}
});
Here is the code on the page that jQuery is loading from:
$DBH = new PDO(DB_DSN,DB_USER,DB_PASSWORD);
$STH = $DBH->("SELECT * F...
Problem:
jQuery DataTables server-side processing using ASP.NET WebForms.
Solution:
Darin Dimitrov answered the question using an example which pages and sorts, but doesn't do any searching. Here's my **basic** modification of his work to make searching work on his example:
public class Data : IHttpHandler
{
public void ProcessRe...
I want to use jQuery to submit my form and i can do that like so
$('#myform_id').submit();
and thats all good but normally someone clicks a submit button than that submit button has a value so when I do the submit via jQuery I also need to set a submit value how do i do that ?
EDIT
as noted by some answers I could do this by simu...
I just asked a question here about selecting all id's of the form id_* where * is any string and id is the id of the element. I got a great working solution:
$("*[id^=" + id + "_]").each(function() {... // id is the element name
I need to take this one step further now:
All of my ids will be of the form: a_b_c ... where a b and c are...
Is there a very simple way to select all H2 tags on the page, then take the text in those H2 tags and add the text of each one to a list.
example:
<H2>I'm number one!</H2>
<H2>I'm number two?</H2>
<H2>I'm number three.</H2>
the script will grab those, and copy their contents into a list when the page is loaded:
<UL>
<LI>I'm number o...
I am performing a selection on various radio buttons whose class starts with the name radio-selection and has some number at the end (e.g. radio-button1, radio-button2, etc). If the radio button is clicked, certain fields contained with that radio button need to be enabled or disabled. The good part is that the class of the that needs ...
I am writing Watin test in MVC Asp.net app. I mvc app, all input are wrpped with form and every time an input or textarea is changed their form gets submitted by jquery like code below:
$("textarea", context).change(function() {
$(this).parents('form:first').submit();
});
This is perfect when changes are done by keyboard. How...
Hi Friends!! I want to set a jqgrid's row by default and to do something with this event. is it possible ? I'm workin' with asp.net (C#) and Json
...
i am using jquery and touchmove event but the code is not showing anything in #info
$('#movieShow').bind('touchmove',function(e){
e.preventDefault();
$('#info').text(e.touches[0].pageX);
});
...
Hello all,
Here's some code that I've seen on the internet to help me out archieving more or less the same:
<input size="30" id="inputString" onkeyup="lookup(this.value);" type="text" />
function lookup(inputString) {
if(inputString.length == 0) {
// Hide the suggestion box.
$('#suggestions').hide();
} else {
...
I dont know how to create regular expression in javascript or Jquery
I want to create a regular expression that will check if string contains only characters between a-z and A-Z with any arrangement
EDIT
When I tried to make regex
/^[a-zA-Z\s]+$/
to accept white spaces as well. It is not working. What could be the mistake.
I am t...
I created a contact form with a text area input only field, which allows the end user to fill out and include a method on how to be contacted. They can choose to enter an email, phone number or both within their message.
I am using jQuery along with javascript to process the form and check if a contact method has been inputted into the ...
Hello All,
I am trying to reproduce standard instant messenger behavior on TEXT area control:
enter works as send button. ctrl+enter as real enter.
$("#txtChatMessage").keydown(MessageTextOnKeyEnter);
function MessageTextOnKeyEnter(e)
{
if (!e.ctrlKey && e.keyCode == 13)
{
SendMessage();
return false;
}
...
I have a table of books with titles, authors, publishers, and dates in it. Under the title column a lot of the book titles start with the word "The." How can I setup the sort within the jquery datatables plugin to ignore the first word if it is "The" when sorting this column?
Thanks.
...