JQuery :: Setting Properties In A 'parameter List' Delimited By {}?
Mar 29, 2010
I want to set opacity parameter value before calling: $('x').animate({opacity:1},v1);
of course, other than setting a switch case line for each possible expected value.
View 2 Replies
ADVERTISEMENT
May 30, 2007
I cannot get anything to validate a comma delimited list of stock
symbols, like "IBM, MSFT,INTC). symbols are alphanumeric with a maxium
length of 5. I want to block multiple, adjacent commas, and allow up
to two blank spaces between symbols.
The following did not work:
(w{1,5}(, *)?)*
View 6 Replies
View Related
Dec 18, 2009
I am currently working on a tween script that I am hoping to make so it allows the user to choose and object than the property it tweens, whether it be height or opacity.so currently my problem is getting the function to accept dynamic property selction.for example, the following.
Code:
function tween(object,property,to,time){
original = object+property;
[code]....
View 14 Replies
View Related
Jul 23, 2005
I know that I can read/write custom properties of an object by using
the following:
Setting:
document.all['Control'].customProp = "this";
Getting:
document.all['Control'].customProp;
Is there a way I can run code when this custom property is set. Or
perhaps there is a way to create a custom method?
Example:
<span id="MySpan"><input type="text"></span>
I'd the property:
document.all['MySpan'].enabled = true;
To automatically do this:
document.all['MySpan'].controls[0].disabled = !thevalue;
OR the method
document.all['MySpan'].enable();
To do this:
document.all['MySpan'].disabled = false;
View 5 Replies
View Related
Jun 29, 2009
I'm trying to create a script which allows multiple different tables to be shown on mouseover of an area (in this case, a table cell). However, I want the tables to appear in a long list for those who have JS disabled. For obvious reasons I don't want two copies of the tables in my html, and obviously only want the mouseover section to appear for those with JS enabled.
The basic problems I have so far is that I can't get the div "plaintables" (which contains all the tables) to be hidden when JS is enabled, and when I mouseover (activating scim()), I get the message [object HTMLTableElement] rather than the actual table.
Pretty much just starting out with Javascript, so this is probably something really simple I have done wrong.
Just incase it matters, I don't have access to the contents of the <head> tag (This is for a site with an existing template) - it would be easier if everything could be done in the <body> section.
View 6 Replies
View Related
Mar 21, 2010
I am dynamically building a part of my HTML page by setting the innerHTML of a DIV element. Immediately after I do that I try to retrieve the clientHeight and clientWidth of the DIV element in order to determine what height and width the element actually ended up being. But I always get 0 as both the height and width. The contents of the DIV, i.e. the HTML code that I inserted into it via the innerHTML, does indeed get displayed on the page. But I suspect that the browser doesn't actually update the page until AFTER my JavaScript code has completed and "returns control" to the browser.
Does that make sense? Is there any way I can force the browser to update the page BEFORE my code completes its processing, so that I can properly retrieve the width and height of the element I just inserted into the page?
View 2 Replies
View Related
Jul 23, 2005
I use URL parameters to track the source of a click and track Pay-Per-Click
results. For example, if a click originates from Google AdWords, the URL is
www.mysite.com/?source=google. For Google this works fine, but for many
other Pay-Per-Click search engines, the URL parameter seems to get lost and
the user gets directed to www.msysite.com.
Let's call the search engine for which this does not work "dummy". I was
thinking about sending users directly to www.mysite.com/dummy.html, and
within dummy.html I would set the parameter within a JavaScript to what
"dummy", using this command: var source = "dummy".
This does not seem to work, the php program that is executed later within
the JavaScript does not correctly interpreted the source variable and
therefore does not register a click from search engine "dummy". So, the
question is, how can I set the source variable within the HTML if it has not
been passed as part of the URL.
View 3 Replies
View Related
Sep 22, 2006
Subject line would seem to say it all:
How does one trigger the execution of a method within an object or any
other code/function with the setting of an object property?
More elaboration for those who want it:
Suppose we have anObjectType, with a property .description, whose value
can be a string, and the value of .description actually describes the
structure of anObjectType as a string. (The details are not important
about how the structure is described, but if you want something concrete,
think of 'anObjectType' as a DOM Node of type NODE_ELEMENT, and
..description as the property .innerHTML.)
When an instance of anObjectType is created, the value of description is
created with the instance. Indeed, the value of description may not be
set with the construction of anObjectType, but it might be added to the
prototype of anObjectType.
But the property .description is not merely read-only. Fetching the value
of .description returns the string which describes the structure of the
object in a meaningful way.
When .description is set with a value of type string, the string is
checked to see if it properly describes a legally formed structured for
anObjectType, and the instance (and only that instance) of anObjectType is
completely re-built: it might possibly be destructed and then re-
constructed, or all properties (but not methods) which involve descendant
objects are changed to conform to the described structure.
The question is, the setting of a string value of the property
..description of object anObjectType does not automatically trigger a
method/methods (or an exception??) for doing something (such as
restructing the object) as a result of the setting of an object property.
View 3 Replies
View Related
May 8, 2010
I want to programmatically list all properties of JS object from C++ code (I am using Mozilla's JSAPI). I know I can go up the prototype chain with JS_GetPrototype, then enumerate each object's own properties with JS_Enumerate.
View 7 Replies
View Related
Jul 1, 2003
Anyone have an online list of properties that can be changed?
In particular, I'm looking to change the properties of a textbox in a form. E.g. Border colour & background colour.
This bit of code allows me to change the text that is initially in the text box (before a user starts to type).
Code:
document.myForm.tboxMsg.value="New Value";
<form name="myForm">
<input type="text" name="tboxMsg" value="Old Value">
</form>
The question is - what else can I change & is there a big list somewhere?
My use of the word "properties" and maybe others may be incorrect...Apologies in advance, I really don't know much about javascript.
View 2 Replies
View Related
Aug 26, 2004
I have a link that i'd like to add a url parameter onto the end and would like to get the value of the url parameter from a selected item in a drop down list box.
<a href="118.phprecordid99=??????" target="_blank" class="links">View</a>
The drop down list box name is combo1. I'm not sure how to reference all this. Is it possible?
View 1 Replies
View Related
Jul 9, 2011
I'm looking for the constructor parameter list for DOM Objects. I was able to find a constructor for Option but none of the others.
Code:
myForm = new Form(params);
myForm.elements.push = new Select(params);
myForm.elements[0].options.push = new Option('Select this!','1');
This is a lot cleaner than
Code:
myForm = document.createElement('form');
myForm.setAttribute('name','theForm');
....
Where I can find a list of these constructor parameters?
View 4 Replies
View Related
Nov 6, 2011
I'm working on a site where we display two lists of boats, sail or power via the organic tabs plugin. Now, our client wants us to show one list type by default depending on the class of the body tag - for example, if the user was on a sailing boat page, the body would have a class of 'sailPage' and therefore the list that would be shown by default would be the 'sail list' - and vice versa for the power (although be default this one shows first anyways as it is the first 'panel' in the HTML') In my admittedly rather clumsy way, I've written the following jQuery function which does seem to work (well, the first half) - however when the user clicks back on to the 'power' tab whilst on page with a class of 'sail', the power list doesn't display. There also seems to be a problem in IE7 where the content of the lists will not display until you select the other tab first, and then select the second tab again?
<div
id
=
"sailOrPower"
>
[Code].....
View 3 Replies
View Related
Aug 12, 2011
Code:I am having problems with the following. I am wanting to hide <tr> in my table (employees) and only show employees that are in the selected department (selected via dropdown box).I need to set a javascript array to a php array. I am looping and assigning the array and am wanting to pass a javascript variable as the index in php array. I have marked my problem lines in red. Thanx for any help.
<script type="text/javascript" >
function display_elements()
{
var departments = new Array;
[code]....
View 1 Replies
View Related
Mar 23, 2009
I'm trying to change the selected index of a List/Menu based on the value of a Text field, I can pull data and alerts, but setting the selection is not working.
<!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">
[code]....
View 2 Replies
View Related
Jun 18, 2006
trying to search thru a string that's delimited by '|'.
would like to iterate over each one in the list
var teststr= "|aaa|bbb|";
var re = /|(.*)|/g;
var results = re.exec(teststr);
if ( results != null )
{
for ( var i = 1; i < results.length; ++i )
alert("[" + results[i] + "]");
}
would like to see 'aaa' and then 'bbb'
does not work - help!
View 1 Replies
View Related
Dec 7, 2006
I need a regular expression that will validate a double quote comma
delimited list where the odd entries are numeric and the even are
alphabetical. Each pair must also be on a separate line. For example:
"1","Peter"
"2","Paul"
"3","Mary"
I've used the following expression to validate comma delimited lists, but
without the double quotes, numeric/alpha pairing and line return
restriction.
^([A-Za-z0-9]?)+([,]s?([A-Za-z0-9]?)+)*$
View 1 Replies
View Related
Feb 17, 2011
I have a gridview that displays client data. The first column on each row for the gridview is a checkbox. The second column on the gridview is client name and the third column is account holder. The user can select checkboxes (on multiple rows) to modify data (account holder).
I want to add clientName column value in a comma delimited string to a hiddenfield on my page. How do I do that using javascript, as I do not want to use postback and looping through each row on the grid to get the checkbox status. When a checkbox is checked, it should append the hiddenfield value.
I am getting the hiddenfield value as blank no matter what checkboxes are checked. I also know that my code is not targeting the correct row to get ClientName (row where checkbox is checked).
function RowClick(CheckBox)
{
var BaseControl = document.getElementById('<%= this.myGrid.ClientID %>');
var TargetControl = document.getElementById('MyHiddenField');
[Code]....
View 3 Replies
View Related
Feb 16, 2011
I have a asp.net gridview that displays client data. The first column on each row of the gridview is a checkbox. The second column on the gridview is client name and the third column is account holder. The user can select checkboxes (on multiple rows) to modify data (account holder).
I want to add clientName column value in a comma delimited string to a hiddenfield on my page.How do I do that using javascript, as I do not want to use postback and looping through each row on the grid to get the checkbox status. When a checkbox is checked, it should append the hiddenfield value.
I am a newb on javascript. Please review my javascript code and suggest corrections. I am getting the hiddenfield value as blank, no matter what checkboxes are checked. I also know that my code is not targeting the correct row to get ClientName (row where checkbox is checked).[code]...
View 2 Replies
View Related
Nov 13, 2009
how to add extra properties to html elements as I was storing data in html attributes. After looking at some others code including Raphael and this addEvent code. [URL] They seem to treat objects just like an array. obj[property] = value; This would have been extremely helpful to know previously as I have needed to be able to include variables in property names - but have resorted to making the whole thing a string and calling exec() on it.
View 2 Replies
View Related
Mar 29, 2011
AwebappI am working onmust use millimeters instead of pixels for the top, left, width, height and font-size style attributes. There happens something strange when setting these style attributes with mm values.
[Code]...
View 4 Replies
View Related
Jun 9, 2009
I have a page that displays a list of people playing in a tournament. I need to be able to generate a Leaderboard based on which players are manually selected by the admin. Next to each person there is a drop-down list. An admin can go in and select a "slot" that a player should be in on the leader board from 1 to 8, or leave it blank if none. What I need to figure out how to do is the following, when a change event happens on a drop-down list, and say the value 5 is selected, I need to check to make sure that 5 is not already selected in one of the other players drop-down lists, in other words, that the 5th leaderboard slot is not already full. if it is, display an error message and make them change that one first. how to do that with jQuery? I'm thinking it will have something to do with the each() function, but not sure exactly how the logic should work.
View 4 Replies
View Related
Oct 8, 2010
i have a menu and i would like to change the color of the Categories which have subcategories only. In my example the basic categories are: News , Announcements , Contact and Career. Only Announcements and Career categories have subcategories. So i would like those two to turn green. The fact is that the list items include a href ,so i don't know how to access those "a href" combined with "this".
<ul id="my_menu">
<li id="id0"><a href="#" style="text-decoration:none">News</a></li>
<li id="id1"><a href="#" style="text-decoration:none">Announcements</a>
<ul>
[Code].....
View 3 Replies
View Related
Jun 2, 2010
I have been trying to make an expand/collapse (essentially accordion) list. So far, everything works and looks fine in Firefox, Safari, and Chrome, but in IE8, the page height is static when it loads, with a page height being as if all headers in the list were expanded. The expand/collapse functionality works,but as you can imagine, there is this big gap of space after the list.
The html markup uses <h2> tags for the always-visible header portion and a <div> for the expanding/collapsing content. The <div> content contains form elements and everything is enclosed in a form tag.Anyways, here is the jQuery code:
$(document).ready(function() {
$('<img src="plus.png" class="icon" />').prependTo('.header');
$('.content').hide();[code].....
View 5 Replies
View Related
Sep 16, 2011
I have the following question.
In my code, Ifirstdeclare a GLOBAL property to store all my global var's in, (with already some properties)[code]...
Does the second block of code overrides the first GLOBAL object? Is there a way to push more properties to an existing object using the same pattern?
View 5 Replies
View Related
Aug 8, 2011
I am trying to get the url and name from a series of links inside a div. I can change from name to ID if necessary, but can't be 100% sure they would be unique within the page. My test is like so
<div id="myLinks">
<a href="http://www.example.com" name="example">example</a><br>
<a href="http://www.google.com" name="google">google</a><br>
[code]....
View 2 Replies
View Related