Control Collection In Javascript

Jul 23, 2005

I have a .net application that I am trying to add some javascript code
to for a client-side execution. What I want to do is resize all the
HTML text fields on my web form, but instead of writing a line for
each text box I would like to loop through a collection of controls
and resize the control if it is a text field. Is there a way to do
this in javascript? The function below is what I have been toying with
for the past couple of hours. Another idea was to use a css, but I
can't find an element for the text field.


function Test()
{
Tarray = new Object;
Tarray = document.Form1.children
for (var prop in Tarray)
{
//document.writeln(Tarray.toString);
var s;
s = prop
if (Left(s, 3) == "btn")
{
prop.height = "20px";
}
}
}

View 3 Replies


ADVERTISEMENT

Javascript Collection, Obfuscation, Crawling?

Jul 24, 2007

I am a visiting researcher at a laboratory this summer and my
current task is investigating javascript obfuscation techniques. I am
trying to get a relatively large sample of website containing
javascript code so I can analyze it and determine if it is:
1) obfuscated
2) malicious

I have a fairly decent inference what the result will be, but it would
be nice to have statistics on my side. Having said that, I believe it
will be necessary to have a very large sample size to perform my
analysis.

Now for my question, does anyone know if there are any ways to utilize
a web browser or other component to automatically find javascript
samples? Google has not yielded any results, and the code search
merely searches repositories; not exactly what I need.

Short of rolling my own crawler, can anyone offer any suggestions that
will aid me in my task?

View 8 Replies View Related

JQuery :: Set Concrete Image Title In Images Collection With Concrete Span Value From Span Collection

Nov 26, 2010

I have this sites: index.html with this code:

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<script type="text/javascript" src="http://code.jquery.com/jquery-1.4.2.min.js"></script>

[Code].....

what I need is set an image title with given index (1)withvalue of span with given index (1). I tried some laborations with gt(), index(), but there is no success.

View 1 Replies View Related

Javascript Font Control

May 24, 2006

I have been unable to reduce the size of the text that goes along with
my image slideshow(the play, next, stop buttons and also the captions
for the pictures) without reducing the size of my title text(my
friends).

View 3 Replies View Related

Menu Control In Javascript

Jul 20, 2005

I would like to set dynamically the pressed item of a menu of a form in javascript. First, how to get the value of the item that has been selected with the mouse. Then how to set it in javascript. I don't know the object name. I do that like form.myfield.value = xxxx with an input text, but it it doesnot work for menu!

View 1 Replies View Related

ActiveX Control In HTML/JavaScript

Jul 23, 2005

Is there any way i can show my excel chart on my web page.

View 2 Replies View Related

Javascript Use <option> From <select> As Control

Jan 20, 2006

i tried to create a dropdown menu and use the option as a control to
change content inside another text area

the code is like this:

<select name="xxxx"><option onclick="changeunitprice(29.87)"
value="1744"/>

the function changeunitprice() is called when an option is selected

problem is it works well with firefox but not IE

any ideas? or is there anyway can make same effect in IE?

View 1 Replies View Related

Using Javascript To Control Acrobat Reader

Mar 28, 2006

I need information (sure, i used google but couldn't find anything useful yet) about automating/adjusting Acrobat Reader using javascript. I need to print multiple documents without having to open them individually and selecting the print option on each document. I also need to adjust the user interface. Sometimes printing is allowed, sometimes it is not. So i need a way to disable (or remove) the print button from the default toolbar.

Anyone has experience (sample code) or documentation i can use?

View 1 Replies View Related

Control Printing (What Prints) With Javascript ?

Jul 9, 2004

When designing a site, a request has come to me about printing web pages. What they want is the page to be broken up into frames, and only one frame will be able to be printed. so that if the page is broken into 3 vertical frames. Would it be possible to have it only print the middle page if the person clicked the print button.

This is so that even beginner users to IE or Netscrape would be able to get a printout of the page without having to change options in the print preferences.

* The example the person gave me was similar to Page Breaks in MS Excel. You can see the whole thing, but when print is clicked, you only get a certain section printing (even a beginner can do this).

View 3 Replies View Related

Hidden Control's Value Is Not Showing In Javascript On MAC Safari

Sep 7, 2005

I'm using input hidden control's value in the javascript function.

same code is working fine on all other browser except a specific
version of safari(i.e.: MAC OS 10.3.7 and Safari 1.2.4).

problem:
control's value is not getting displaying at the first time
when the page gets load, although the same piece of code would work if
I just refresh the page, strage.

declaration of hidden control:
<INPUT id="hSliders" type="hidden" runat="server">

javascript code which is calling the value of hSliders:

alert(document.Form1.hSliders.value)

this alert is showing nothing although it should display string.

i check the view source also control's value is getting populated.

View 1 Replies View Related

How To Dynamic Control Some Picture's Size By Javascript

Feb 14, 2006

i have some pictures in a page. there are have difference sizes. some
of them are too widen for be arrange in a line. so
i been tried to adject their sizes to more suitable.

i add a event to that image likes:
<img id="img" onLoad="adjustSize(this)" src="123.jpg">

and write a function in javascript:
function adjustSize(obj){
if (obj.width>250){
sizeRate=250/obj.width;
obj.width=obj.width*sizeRate;
if (obj.hight>268)
obj.hight=268;
}}

but exactly,i can get the image's width and height. cuz the loading
hasn't finished while the function of adjustSize works.

View 5 Replies View Related

JavaScript Ticker Using Tabular Data Control

Dec 10, 2002

This JavaScript Ticker is an example of "Data Binding" using "Tabular Data Control (TDC)" which is a Microsoft ActiveX control built in to Internet Explorer....

View 6 Replies View Related

Javascript Control For HTML Radio Button

Mar 24, 2006

I'm not what you would call naturally gifted with javascript (I use PHP mostly), so I hope this is an easy question for one of you....

I'm trying to create a HTML link that, when clicked, affects a pair of HTML radio buttons by moving the selection from one radio button to the other.

the following code is wrong, but It's all mine, and its what I've written in a feeble attempt to accomplish this:

<HTML>
<HEAD>
<TITLE></TITLE>

<script type='text/javascript'>
<!--
function rejectAll()
{
if (window.document.link_form.a0.checked == 1)
{
window.document.link_form.a0.checked = -1;
}
}
-->
</script>
</HEAD>
<BODY>
<form action='file.php' method='post' name='link_form'>
<input type='radio' name='a0' value=&#391;' checked>
<input type='radio' name='a0' value='-1'>
</form>
<a href='javascript: void(0)' onClick='rejectAll();'>Reject All</a>
</BODY>
</HTML>

Can anyone see what I'm trying to do here and point me in the right direction...

View 3 Replies View Related

Getting The Collection Of Checkboxes

Jan 31, 2006

I have a form wherein there are around 200-300 rows of homogenous
data, each having around 30 input fileds of its own.So totally, there
are more than 6000 input fields . Now, when the user submits this page,
i need to loop through the checkboxes and identify the ones that are
checked. I can't use the getElementsByName() since the checkbox names
are different. I'm using getElementsByTagName("input"). Because of the
huge amount of data, this method takes around 4-5 secs to evaluate
before submitting the form. Is there some way to get the collection of
checkboxes without having to loop through all the input fields?

View 1 Replies View Related

DOM Attribute Collection

Jan 24, 2006

I've been working on a dynamic script using the DOM and wanted a routine that would parse out the element attribute collection. I came up with a routine that works in FireFox 1.5 and Opera 8, but it doesn't work in IE 6. Any ideas? Code:

View 3 Replies View Related

JQuery :: How To Get Object From Collection

Jun 15, 2009

I have collection: var collection = $(input);
var i = 3;
Is there easier way to get third jquery object from collection. Currently I'm using method like
$(collection.get(i)) or $(collection[i])
But I think something like this could be more comfort:
example: collection.get(i).addClass('....');

View 3 Replies View Related

Error - Object Not A Collection

Mar 25, 2011

Here's one that I don't understand:

<script type="text/javascript">
fso = new ActiveXObject("Scripting.FileSystemObject");
myCollection = new Collection();

[code]....

During execution, I get a "Object not a collection" error when I try to pass "MyCollection" to the Enumerator function. What am I missing?

View 5 Replies View Related

JQuery :: Selecting One Block In A Collection?

Mar 27, 2010

I have a structure of similar blocks

- all containig a clickable image

- each identified by a unique hidden index

I want to find the value of that index when clicking on the image The code is something like :

<div class="bloc">
<p class="enTete">
<img class="modif" src="monImage">
<input type="hidden" value="1" />

[Code].....

How can i write the selector to read the right index when one the image is selected ?

Somethig like : (The '?' means I dont find how to do !!!!)
$(' ? .modif').click(function() {
test = $(' ? .index').val();
alert(test);
});

View 1 Replies View Related

JQuery :: Validate Collection Of Fields?

Jan 31, 2011

How can I validate a collection of fields, instead of validating the whole form? I'm using asp.net which uses one form element, which I even don't use. I have a tab panel with on each tab a couple of fields. I only want to validate the fields on a tab.

View 3 Replies View Related

Getting A Collection Of Form Values Into Array

Nov 11, 2011

'm having a very hard time making this work and be happy in both IE and Firefox. Basically, I'm setting a timeout to get an array of the form values if not present, or compare against if they are present, and if any change in values, submit the form to auto-save it.

below is my coding, basically I am using document.forms[thisformname].elements - but that gives me a lot of things that are NOT form fields and I just need to read input:text, input:checkboxk, input:radio, textarea, and select elements - nothing more. I'm open to any suggestions and some of you smart guys could probably write this in half the lines I did.

Code:

//auto-save coding
var autosaveTimelapse=0;
var autosaveTimeout=3; //every n seconds

[code]...

View 6 Replies View Related

Parse Collection Object Using Prototype?

Jul 6, 2009

I have the following nested javascript collection (below) and I'm trying to access the information within the collection using prototype so I can properly style and layout the data.

var teams = {
"team1:" {
"QB": "Alexander Hamilton",
"RB": "John Jay",

[Code]....

View 9 Replies View Related

Need Next-previous Control To Control Contents Within An IFrame?

Oct 10, 2011

Situation:I have a very long page divided into many sections vertical-wise marked by bookmarks, say pageX.html#s1 to s10. I need to show the section inside an iframe (iFrame1) on the mainpage (mainpage.html). I am thinking of having 4 buttons, sitting on the mainpage, to help navigate between these sections on pageX, namely NEXT, PREVIOUS, TOP, END.condition of the frame, fixed width/height, no scroll, no border.Very new to javascript but need this code to make a page work for BIZ.

View 1 Replies View Related

Checking For Memory Leaks And Garbage Collection

Mar 9, 2007

I'm working on an Ajax library that I plan to use on several upcoming
projects. Everything seems to work just great...

Now I want to get into the finer aspects of checking things... How
much memory am I using, are my objects making themselves available for
garbage collection adequately, etc.

Are there tools you can recommend (especially for IE and Firefox) that
I can use to get this information?

View 1 Replies View Related

JQuery :: Getting Collection Of Table Cells After Using .parent?

Aug 3, 2011

I'm using .parent on a draggable table row and need to check the contents of every cell in a particular column in the table. $(ui.draggable.parents("table")[0]) This gives me the table.. how do I get say the collection of cells in column 2. I thought about something like this: $(ui.draggable.parents("table")[0](tr td[1]))

View 2 Replies View Related

JQuery :: Selector On Existing Collection Containing DIV Elements

Jun 3, 2010

Let's say $pages is a collection containing all div elements that have an id of page1 or page2. From this, I wish now to select now only the page div (i.e page1 or page2) that contains a descendant with a class of 'A'. Tried lots of things, just can't get the format right.

View 5 Replies View Related

AJAX :: Event Handlers And Garbage Collection?

May 2, 2009

I've written some functions that seem to be able to handle parallel AJAX requests. However, I am not sure if they would work under all circumstances.My idea was to create a separate object for each AJAX request in order to bind the right handler function to the appropriate .onreadystatechange. I have used an array to store references to the created objects so that they would not be garbage collected as long as needed (see the lines commented out below). I have noticed, however, that everything works nicely even if I don't save these references -- so, with these lines commented out.

My question basically is whether it is safe to do so, and what prevents these objects from being deleted by the garbage collector. As both the event and the handler function appear to be in the same object, I think it will not stop the garbage collector.

In my code, ajax_req() is called to make a request; it will create the new ajax_abs object whose constructor takes care of the rest.

// ajaxrequests=new Array();
function ajax_abs(method,page,str,dest,todo,myno){
function init(){

[code]....

Furthermore, is it possible to tell the interpreter after the request succeeds, that now it should garbage-collect the object?

View 1 Replies View Related







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