document.getElementById('hello').style.border-top = "2px red solid";
What I'm trying to do is just change the top border color of something I defined with css. The code above of course didn't work.. heh. How would I do it?
The following information is passed to a script to generate an email from a form. <INPUT TYPE="hidden" name="param_recipient" value="me@mycompany.org">
In the form further down on the page, a user enters a value in the ru field. I want to write something similar to: if ru=122 then sendformto="me@mycompany.org" if ru=144 then sendformto="you@mycompany.org"
the paramater above would then become something like: <INPUT TYPE="hidden" name="param_recipient" value=sendformto>
I have downloaded 2 html pages that give me page1 with a drop down box for a list, and a 'show' button. this then passes dropdown value to page2 and JS presents the text on the page, but I want to use the passed parameter to change the src of an img with ID=img1.can post all the JS if you like but assume i am missing just a one liner replacing the ....
var name = getValue("name"); document.write(name);
I have an image with an onclick function and parameters 0, 1. I want to change the parameters of the onclick function through the same function? <img id="down0" onclick=swap(0,1) /> <javascript> function swap(a,b){ var imgda=document.getElementById('down'+a); imgda.onclick = swap(b,b+1); } </javascript> Normally it should change the onclick to swap(1, 2) but it remains 0, 1.
I have a strange problem... I have a form with a text area that contains an XML document. This document can be modified by the user.
Once the document has been modified, the user pressed the "Submit" button to submit the modification (onclick=modify())... and go to another jsp page.... in my javascript, I have the following code:
function modify() { myRand=parseInt(Math.random()*99999999); // cache buster var docXML=document.forms[0].xml.value; var plist="myRand="+myRand+"&docXML="+escape(docXML); url="modify_xml.jsp?"+plist; document.forms[0].action=url; document.forms[0].submit(); }
With Firefox, the problem does not occur.... but with Explorer, the form is not even submitted!!!!! Is there a workaround for this? The XML document is not even very big.
Trying to have plain text that you can click (div of newslink) which toggles the right parameter of other element (div of rightSidebar). Set rightSidebar initially with css: #rightSidebar {right:200%}
Here's what I have for script, but still not working:
if the check box is unchecked it should pass value = 1. i.e. <INPUT id="ReviewedBy" style="WIDTH: 16px; HEIGHT: 20px" type="checkbox" name="ReviewedBy" value = 1>
Since the reporting service passes value directly i couldn't write any server side code.
In client side validation i could diplay the value of check box in alert message but i couldn't pass it as parameter to the report server.
I'm curious if there is a possibility of being able to search the whole document for a specific string using replace("that", "this") for example to find any reference to "this" and replace it with "that" and then show the modified content.
so that the script fills in the page. I've hacked together something that inserts the foo.shtml into foo's div then does a fooDiv.getElementsByTagName('script') and uses eval() on them and it works most of the time in some brossers but it seems hackish and somewhat dangerous and it doesn't work everywhere. Surely there's an AJAX idiom (or even a DOM built-in) to execute scripts as parts of pages load.
I found a nice script over at jQuerry for Designers that I'm using in a Drupal site. It seems to work fine, except for that every anchor tag on the page triggers the script! how can i adjust the script to target a specific anchor (currently has an ID of "test") and ignore all other anchor tags? here's the script, its placed in an external .js file:
I just wanted to get your opinions on this: I have several pages with page-specific JavaScript (i.e. script I know cannot be reused...it can only be run against elements found only on that page).
My question is, would you recommend just putting it in SCRIPT tags in the header, or should I create thispage.js so that the code is separated into another file? It slows the request because the browser has to ask for another external file, but keeps code out of the HTML doc.
Hi everyone - Ok, sorry - I'm new, but I'm trying hard to learn. I'm working (for free) at a church that have asked me if it is possible to change their webpage backgrounds, based on specific dates (this is so it fits in with the liturgical calendar). I'm not 100% sure of all the dates yet, but know there are seven images with assocaited colours that they'd use, and would like the website to automatically change the backgrounds, based on specific date.
I have a popup window which is a slideshow of about 7 images. When the popup window loads, the first image is present and then the viewer can select next or previous to scroll through the rest of the images.
I'd like to use the same popup window at different points throughout the website and have the Virtual Tour (slideshow) open up at the appropriate photos. Meaning I'd like to control which picture the popup window opens up to, depending on where the user is in the site.
Does anyone know where I can find code that does this? I am somewhat familiar with Javascript but would like to find some ready-made code which accomplishes this.
I want to add a color change to an anchor tag. But only on a few pages. I am trying this but it does not work: $(function(){ var urlName = [URL] if (urlName == window.location.href) { $('.news-list-item > h3 > a:first').css('color','#8CAAC3').css('text-decoration','underline'); }});
I'm attempting to change the display property of certain divs depending on the criteria of multiple select boxes.
I got it to work by GetElementsByTagName('div') but it then selects all divs rather then the select few i actually want it to work on. I tried changing the selection to GetElementsByName but this doesn't work, why i don't really know.
I am current building an information database for the company I work at...basically just a place for employees to get information and answers from. It is all hosted on a local server and I can only use javascript, html, and css. I've got everything made there is just one thing i want to add to it. Basically an "alerts and updates" page that only some people can edit without having to know html so if im not there they can post important updates. No computers have access to the internet so I did try some rich text editors but none of them worked. The layout I'm going for is kind of like this.
Alerts and Updates Click on links to show updates: update 1 * update 2 * update 3 * update 4 Stuff goes in the update [edit button] You click edit it prompts you to login, bring up something to edit the text in that specific update you hit submit and it changes the info that was on there. The update links are linked to a script I wrote that just display the info below so when the page loads you see whats in update 1 then you click update and it changes the content to the next one.
What is happening is $(this) is no longer based on .expand being the (this) that is clicked.
like if i have a button SOMEWHERE randomly on the page with this
<div onclick="Minimize('_alerts');">Click Here</div> this will minimize alerts but because the (this) in minimize function doesn't actually point to the right button that I want to add a class to.
Is there a way to modify the minimize function so that it finds the <div id="mytoggle"><ul> <li class="expand boxminimize" rel="_alerts"> using the rel toggle, and then changes the class of the li from expand boxminimize to boxexpanded??
just like the .expand click function I posted on the top of the post that works?
I do pretty much all the computer related tasks, which includes computer system repair, audio/video editing, cd/dvd printing and duplication, document format and creation, etc etc. But when it comes to HTML (or other codes) I know very little. But we needed a website, so I use Homestead hosting and the Homestead (offline) Site Builder program.
Anyway, inside the sight builder program, they have the option to insert HTML Snippets. Which I use for various objects, off site tools, and other. But now I need to do something for which I have not been able to find a "premade" html code object, that can perform the task desired. I have searched and searched google and went through many sites, including this one. I have tried to take some codes which I thought I could alter to make it perform, but they just wouldn't work for what I needed them to do.
I need a code that will automate a "specific text message" to change daily, and to schedule a "different specific text message" to appear each day. I need to be able to schedule each days "texts" at the very least 31 days in advance. In other words, I need to make an array (I think that's what it is called) for the entire month:
Day 1 "today's text 1" Day 2 "today's text 2" Day 3 "today's text 3"
[code]....
If were possible to make an "array" that would go six months out (or more) that would be very helpful! But the longest that I have seen is one month at a time, so that may be as long as they go, but I'm not sure.On top of all of this, I need these changes to be performed at a specific time of the day. I would like them to be preformed at sunset everyday, but I don't think there is anyway to direct the code to look at like [URL] sunset times or such. So if I can at least choose a specific hour, like 8:00 pm, that will work, I will just have to adjust this every once in a while.
However, I don't want it to change just at 8:00pm in my timezone. I need it to change at 8:00pm according to the website viewers timezone. Is there a way to make the code "look" at the users computer and "get their time" and use that to adjust what text is displayed? In other words, I live in Indiana USA. If someone in Australia looked up the webpage on the 15th day of the month, but it was 9:00pm Their Time. The text I need to be displayed should be for "Day 16" from the array.
Another thing that has been driving me crazy is that css positioning is handled differently by different browsers. JS is not my area, but I can do a lot with CSS, and I do, but cross browser compatibility is killing me.
I can use an IF IE statement and only IE runs that segment of code, but I haven't been able to figure out out how to make ONLY firefox or ONLY opera or safari enact an encapsulated segment of code. The same type of IF statement doesn't work for them.
Is there a single method using JS that works for all browsers?
function result(){ var result = document.getElementById('resss').innerHTML; }
But what I actually want is to import data from a table of an external website. E.g. I want to get the innerHTML of a specific cell in column 3 and row 2 of a specific site.