Accessing Fieldnames With [] In Them
Jul 22, 2003
Is there a way in Javascript to access a field with [] in it for example
destList[]. I need to have this since the field is a listbox and it contains multiple options. it gets posted to the server and handled by PHP. in order to have all the options submitted to the server the name of the field needs to have a [] on the end of it.
View 5 Replies
ADVERTISEMENT
Apr 12, 2006
A have an array of objects defined like this:
var collegas =
[{smtp:'alberic.verhelst@king.dom',voornaam:'Alberi c',famnaam:'Verhelst'},
{smtp:'anita.dierens@king.dom',voornaam:'Anita',fa mnaam:'Dierens'}, etc
I iterate over this array with this code :
for (var i = 0, stop=collegas.length ; i < stop ; i++) {
for (var veld in collegas[i]) {
etc
I would like to check whether a particular veld instance's name is smtp. In
code what I want is this :
if (veld.fieldName=="smtp") { do something ...
But this syntax doesn't work.....
View 2 Replies
View Related
Jul 23, 2005
I call a javascript function in my page load that accesses an iframe and I get an error. But if I wait till the page completely loads and access the iframe through a click event
everything works fine.
I'm trying to set some of the iframe's properties on page load. Can I do this?
View 4 Replies
View Related
May 31, 2006
Is it possible to take an ASP textbox that has an attribute of
visible='hidden' and make it visible from javascript? I dont want it
to be visible until data on the page has been entered and thus need a
way to dynamically change its visibility?
View 3 Replies
View Related
May 17, 2007
How can I access to specific element by javascript and not by using the getElementById method.
View 1 Replies
View Related
Nov 30, 2010
I'm loading an XML document and grabbing a node with content in it including html. I can't figure out how to grab the src of the first IMG tag that appears in this text string
View 2 Replies
View Related
Apr 3, 2009
all on the same page that are accessed by the classic show/hide DIV functionality.
So user clicks button 2, which shows story 2, hide stories 1 and 3. (all on the same page).
The issue is that I've been asked to provide a method to directly link to story 2 or 3, which currently isn't possible since you need to load the page, then click the button to show story 2 or 3 (naturally 1 loads by default).
So I'm looking for any method to go right to story 2/3 from a link.
Perhaps I can pass a variable through the URL which executes the function as soon as the new page loads (which would mean a quick double page load but I could handle that)
Here's the function:
var showMe = function(me) {
document.getElementById(me)["style"]["display"] = "block";
}, hideMe = function(me) {
document.getElementById(me)["style"]["display"] = "none";
[Code]....
View 9 Replies
View Related
Nov 23, 2006
I'm trying to figure out how to access body if it has no name or ID.
<html>
<head>
<title>blah</blah>
</head>
<body>
<p>example paragraph</p>
<style type="text/javascript">
document.getElementByTagName('body').setAttribute('bgcolor', '#000');
</style>
</body>
</html>
It didn't work. I also tried both of these:
document.getElementsByTagName('body').setAttribute('bgcolor', '#000');
document.getElementByTagName('body').item(0).setAttribute('bgcolor', '#000');
View 2 Replies
View Related
Dec 8, 2007
I'm trying to access a div within another div, but get an error stating that the firstChild object of the div is not an object. The code I am using is as follows:
<html>
<body>
<div style="background-color:whitesmoke; width:100px;" onMouseOver="javascript:highlight_row(this)" onMouseOut="javascript:unhighlight_row(this)">div 1<div>div 2</div></div>
</body>
</html>
<script>
function highlight_row(obj)
{
obj.firstChild.style.display = "block";
}
function unhighlight_row(obj)
{
obj.firstChild.style.display = "none";
}
</script>
View 1 Replies
View Related
Oct 21, 2011
I'm not an ace JSer by any means--the problem I'm about to pose could easily be solved with pointers in C++ (the language with which I am most familiar), unfortunately that is not an option.I am making a webapp using the google visualization API:URL...My problem may be related to the API, but I think it's more Javascript oriented--the Google group for the API is helpful,I have a function, drawDash(), which declares some elements of the visualization, some filters for the visualization, then binds them together and draws them. Now what I need to do is access the elements of one of those vars, specifically a filter, and add/change properties of it with an HTML form.
I've set up an onclick function for a set of checkboxes in my form that calls another function. The problem I face is that I can't really access the filter correctly.[code]So basically, I want to have a function be able to edit the var serviceSearch from another function.
View 4 Replies
View Related
Nov 30, 2003
I have a page with a link and a DIV with visibility=hidden. The target of the link is to a hidden IFRAME. The link executes a script in the hidden IFRAME. When the user clicks the link, I change the DIV's visibility to visible. Depending on a condition in the script executing in the hidden IFRAME, I want to change the DIV's visibility back to hidden. How would I do this?
document.parentWindow.all("DIV").style.visibility = "hidden"
but it didn't work.
View 1 Replies
View Related
Sep 7, 2011
This is probably a ridiculously simple task, but I am new to Javascript, so here goes. Is it possible to get the 'id' (and other attributes) of a 'div' area after I have clicked into it?
View 9 Replies
View Related
Jul 12, 2009
I'm trying to develop a google maps a site with two frames.In frame one i have a line of code as follows:var myPano = newGStreetviewPanorama(document.getElementById("pano"));The problem is that "pano" is the id of a div in frame 2, so I'm wondering how to access it.
View 10 Replies
View Related
Jul 23, 2005
I have 2 arrays:
var A1 = new Array();
A1[ 0 ] ="Y2";
var B1 = new Array();
B1[ 0 ] ="Y1";
B1[ 1 ] ="sink";
I also have a drop down menu with the names of the arrays. Say:
document.form.option[1].text returns 'B1'
Can I transform the string 'B1' into the array B1, so that:
document.form.option[1].text[1] returns 'sink'
Currently I'm doing this with conditionals, e.g.
if(document.form.option[1].text =="B1){do stuff}
but this gets a bit messy.
View 2 Replies
View Related
Jul 23, 2005
I have a situation where I'd like to read/parse the content
of a file I've read into an <IFRAME>. I've looked through
various FAQs and searched forums, and the closest I get to
accessing the file content is
myIframe.contentWindow.document.body.innerHTML
where myIframe is the node from getElementById(). But while
I can see the content of the file on my web page, I get an
empty string from the above reference. How do I get to the
file?
View 2 Replies
View Related
Jul 23, 2005
Firstly, I am aware of all the issues that are introduced with frame
pages - this was not my decision - it is just what I have to work
with...
I have a frame page that looks like this
-------------------
| topFrame |
-------------------
| navFrame |
-------------------
| ContentsFrame |
|------------------
Within the contents frame I have a NEW FRAME set which looks like this
--------------------
| | |
|treeFrm | frmDisp |
| | |
--------------------
I know that this is awful. I have a link in the contentsFrame. When I
move over that link, I need to get a layer that already exists in the
frmDisplay to become visible..
View 1 Replies
View Related
Jul 23, 2005
I have this problem in xsl wherein i want to access a variable in
javascript and use it my xsl. How would i access or use a javscript
variable in my xsl file?
View 5 Replies
View Related
Jul 23, 2005
When are named elements written with script accessible to script?
<html><head><script type="text/javascript">
function ready() {
alert( document.getElementsByName("div").length );
}
</script></head>
<body onload="ready()">
<script type="text/javascript">
document.open();
document.writeln( "<div name="div"></div>" );
document.close();
</script>
</body></html>
IOW, why are there 0 elements named div at the time the <body>
element's onload handler is invoked? When can I retrieve this named
div from the document hierarchy?
This exercise is necessary since code I have written using the DOM
(that works) has to run on God-forsaken browsers such as IE 5.1 for
Mac whose support for the DOM is spotty at best.
View 15 Replies
View Related
Sep 8, 2005
I have a javascript function that needs to access methods of a java
object(localTag). In my JSP I'm trying to include hidden fields for
the Strings returned from the getter method calls of the object like
so:
<html:hidden name="FrmCustomerHolding" property='<%=
"localTag.getTagName()" %>' />
<html:hidden name="FrmCustomerHolding" property='<%=
"localTag.getTagValue()" %>' />
If I can do something like this, what is the correct syntax and how do
I access this property in my javascript? When I have a hidden field
that is just a String, I access it in the javascript like
"document.getElementById("theString").value" and it works fine, but I
can't seem to find how to access the String value of a method call.
View 2 Replies
View Related
Jul 20, 2005
I have seen web pages sites, when you drop down a list box, it seems to go
back to the server to retrieve some data without reloading the whole page
(e.g. select make of car and it retrieves a list of models from the server
to populate another list box).
View 1 Replies
View Related
Jul 20, 2005
I'm looking for a way to do:
function resetBorder(theObj) {
theObj.style.border = theObj.class.border;
}
But it doesn't seem to be as simple as that, I'd like a cross-browser solution, but will settle for IE.
View 3 Replies
View Related
Jul 20, 2005
I'm having an issue with CSS, JS and the DOM. It's gonna drive me batty. I
am trying to access the properties of a layer in JS which have been
initially set in an external CSS. The problem is that for some reason JS
isn't receiving NULL for all the properties of the layer. For instance:
HTML
<div id="blarg">.....</div>
JS
var t = document.getElementById("blarg").style.left;
CSS
#blarg{
position: absolute;
left: 200px;
}
t == NULL and I can't figure out why. It is this way for any CSS attribute
I attempt to read (width, positional, the whole kit and caboodle).
It does work if I set the attribute in JS before I read it.
JS
document.getElementById("blarg").style.left = 30;
var t = document.getElementById("blarg").style.left;
t now == 30. The only thing I can think of to explain this is that when
the document gets loaded my layers aren't getting their attributes filled
out. The object gets created and the attribute fields are blank until I
fill them in. Thusly my creation of CSS's was a waste of time. Grr...
Any ideas/suggestions? Google has been of no help. :-( This is occurring in
IE 6, and the gecko engine browsers.
View 4 Replies
View Related
Sep 23, 2010
I have implemented a jquery tab, which displays a form with some fields into it. I want to access those field values through javascript that are displayed in the tab.
View 2 Replies
View Related
Jan 28, 2010
So im trying to create a simple file menu, so far I have :
$(function() {
//Rolling over menu items.
$('#FileMenu a').hover(function(e) {
[code]....
View 3 Replies
View Related
Apr 6, 2011
I've been writing a script using the Flickr API. Basically it takes photos from a certain set and user and puts those in the fancybox format. The problem I have now is that whenever I want the set to change, I have the edit the javascript,. Instead I want to be able to change this in the html where it's being called.
[Code]...
View 3 Replies
View Related
Mar 29, 2011
Currently I have one issue where i have defined my four input tags inside a div.Now the issue is arising that i need to separate them each using the table tag or either the nested div tag to make their width..currently my show is like this
<div class="row">
<input type="text" id="text2" name="text2"/></br>
<input type="radio" name="text2Radios" value="1" class="ToBeED"/>1 </br>
[code]....
View 7 Replies
View Related