If Then To Change A Parameter In Javascript

Nov 30, 2006

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>

How would I go about doing this?

View 3 Replies


ADVERTISEMENT

Using Javascript To Change Specific Css Parameter

Nov 5, 2003

Code:

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?

View 21 Replies View Related

Change Img Src With Passed Html Parameter?

Feb 1, 2010

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);

View 4 Replies View Related

How To Change Parameter Of OnClick Function

Aug 6, 2010

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.

View 2 Replies View Related

Function Parameter Won't Change Styles

Jun 8, 2009

My script is below

Why wont the Parameter e work in

document.theform.e.style.border="1px solid red";

but it will show the value of e in alert(e) [code]...

View 2 Replies View Related

XML Document Passed As Jsp Parameter In Javascript Ok With Mozilla, Not In IE!!

Sep 27, 2007

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.

View 7 Replies View Related

JQuery :: Toggle Text Link To Change Parameter?

Jun 15, 2010

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:

<script type="text/javascript">
$j(document).ready(function(){
$j('#newslink').toggle(
function()

[Code]....

View 2 Replies View Related

Javascript : Pass Chkbox Value As Parameter In To MSRS Report

Nov 10, 2005

I am using asp.net to pass parameters from .aspx page to my Microsoft
reporting service.

My .aspx page has checkbox. If it is checked it the chekbox should pass
value =0 to my report

<INPUT id="ReviewedBy" style="WIDTH: 16px; HEIGHT: 20px"
type="checkbox" name="ReviewedBy" value = 0>

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.

View 1 Replies View Related

Change Variable In Javascript

Oct 22, 2006

i use the following script (from textbook) to restrict 160 character in
Message_cont textbox.

how can i to change the number of character to 70 if any double bytes
character detected in the textbox. Code:

View 2 Replies View Related

Javascript: Img-Change-Problem With IE

Jul 20, 2005

I've a problem with JavaScript and IMG-Objects.
On my webpage I use a big image and several small images. If you click
on a small image, it executes a JavaScript to change the source of the
big image to the source of the small image.

It's working fine, but on some browsers (I use IE 6.0.2800.1106) the
image doesn't change properly.
I click on the image and the big image turns white. Now I have to
click on the image again and sometimes it works and changes the image
(without reloading the site). I've found no logic, why it's working
only sometimes. Code:

View 2 Replies View Related

Can I Change An Href In Javascript?

Jul 20, 2005

I am using some javascript code to change an image on an html page. I would
like the user to click on the image to bring them to another page. I need to
change an href to include an id value based on the image.

Here's the process:

1. select an image from a drop down list.
2. view the image on the same page.
3. click on the image to bring user to another page.

Here's my attempt at it:

function nextimg() {
txtString =
document.Topics.sel_val.options[document.Topics.sel_val.selectedIndex].value
document.image1.src = txtString.substring(txtString.lastIndexOf("&") + 1);
document.frmPic.href="details.asp?id=" & txtString;
}

I also think that txtString is not what I need. I believe it is a text
string (12345.jpg). So I will need to parse the string as well to get the
"12345".

View 2 Replies View Related

Change CSS Class Property Using Javascript?

Jul 23, 2005

I have several tags on a webpage of the same class. If the user clicks a
specific checkbox I'd like to be able to alter the display property of the
class, affecting all objects of that class.

This is an intranet application so we know that javascript will be enabled
and the browser will be IE.

How can I affect all the members of this class? Is there a way I can toggle
the DISPLAY property of a class so all the elements using that class would
be affected? Code:

View 3 Replies View Related

Change Link Colors From JavaScript?

Jul 23, 2005

I'm writing a FireFox extension and I have the dom and therefor the
links[] collection

window.getBrowser().contentDocument.links[i]

Is there a way to change the color of these links based on the stuff I'm
checking for from the JavaScript?

For example. If I have this loop
var number_of_links = window.getBrowser().contentDocument.links.length;

for (var i=0; i < number_of_links; i++)
{
var domain = window.getBrowser().contentDocument.links[i].hostname;
//Check hostname here and change color
}

how could I change the links color?

View 1 Replies View Related

Howto Change Quicktime Src With Javascript?

Dec 27, 2005

I'm trying to change src of quicktime embedded object with javascript:

<html><body>
<script language="JavaScript">
function Exchange()
{
document.qtvr.src = "sample2.pano";
document.embeds["mov"].src = "sample2.mov";
}
</script>

<object classid="clsid:02BF25D5-8C17-4B23-BC80-D3488ABDDC6B"
width="600" height="400"
codebase="http://www.apple.com/qtactivex/qtplugin.cab" id="qtvr">
<param name="autoplay" value="true">
<param name="controller" value="true">
<param name="pluginspage"
value="http://www.apple.com/quicktime/download/indext.html">
<param name="target" value="myself">
<param name="type" value="video/quicktime">
<param name="src" value="sample1.pano">
<embed src="sample1.mov" width="600" height="400" autoplay="true"
controller="true" border="0"
pluginspage="http://www.apple.com/quicktime/download/indext.html"
target="myself" type="video/quicktime" name="mov"></embed>
</object>

<a href="#" onclick="javascript:Exchange()">exchange</a>
</body></html>

but IE said that "document.embeds.mov.src is not object", and image
isn't changed ( IE,Mozilla) when user click on the link "exchange".
What is wrong, how to do this correctly?

View 15 Replies View Related

Change The Domain, Keep The Path..with Javascript?

May 25, 2007

I'm currently at http://www.domain.com/the-path.jsp, and I would like
to be able, with JavaScript--and possibly the click of a button, which
I will most likely attach to IE's toolbar--transport to
http://domain.dev.domain.com/the-path.jsp.

Here's the environment: My browser is set to the page http://www.domain.com/the-path.jsp
and I plan to add a button to IE's toolbar via the registry that I
would like to execute the JavaScript, which contain the code to
perform the aforementioned procedure.

My JavaScript knowledge is, as I'm sure you've already surmised,
limited.

Here's what I know (or what I think I know)

The .js file header:
oShell= new
ActiveXObject("WScript.Shell");

the object: window.location.replace [or href].

I have a feeling a "and if" statement is needed here. Am I correct?

BTW: As far as the registry button addition is concerned, I'm set on
how to do that.

View 2 Replies View Related

Table Background Change Using Javascript

Dec 11, 2006

I'm trying to make a javascript menu. As a start, I want the background of the cell to change to a specific image on mouseOver. Does it not work because of the "background-image" translation from CSS to JAVASCRIPT or could it be something else.

<html>
<head>
<title>Untitled Document</title>
<link rel="stylesheet" href="main.css" />
<script language="javascript">
function change()
{
document.getElementById("homebtn").style.backgroundImage="imgs/btn_black2.gif">;
}
</script>

</head>
<body>

<table width="100" >
<td>
<tr style="background-image:url(imgs/btn_black.gif)" class="myFont" onMouseOver="change()" id="homebtn">- Home</tr>
<tr>asdfsdf</tr>
<tr>asdfsdf</tr>

</td>
</table>
</body>
</html>

View 1 Replies View Related

Change The Order Of Javascript Events

Sep 24, 2006

I'm using this script to allow people to populate form fields just by hitting the words from a list that most appeal to them. The idea is that on clicking a word the field is filled in and then "focus" is moved to the next one. I say "focus" because it's not actual focus, but "virtual focus" held in a js variable. Code:

View 2 Replies View Related

How To Change CSS Text Size Using JavaScript

Apr 1, 2002

I would like to know how i would go about changing my CSS text size by selecting a value form a select list.

I was told it would be pretty easy with DOM? but i dont know enough about JavaScript or DOM to figure it out. Code:

View 13 Replies View Related

Using ADO From JavaScript In HTML To Change A Spread Sheet

Feb 17, 2006

I'm trying to use client side JavaScript from an HTML file to open
and make changes to an Excel SpreadSheet using ADO w/ ODBC. What a
pain it is to do this. Anyways, I am able to open the excel file but I
don't know how to use ADO to work with it's contents. So far I have
the following code that works:

<html>
<script>
window.onload = function () {
var ExcelSheet;
var sConnect = "DRIVER={Microsoft Excel Driver
(*.xls)};DBQ=P:js-test.xls"
ExcelSheet = new ActiveXObject("ADODB.Connection");
ExcelSheet.Open(sConnect);
}
</script>
<body> =) </body>
</html>

Now that I have the sheet open, how do I manipulate it?

View 13 Replies View Related

Change Background Color Of Called Javascript

Feb 6, 2006

my new web host offers dynamic content, like news headlines. The script it generates has limited style options, it does not allow for transparent background color.

I have tried applying a <span class> tag around the called script, but the style is ignored.

.transparentbackground {
background-color: transparent;
}

<span class="transparentbackground"><script class type="text/javascript" charset="UTF-8" src="tinc?key=DvSWwMiI"></script></span>

Is there anyway to change the style of the called javascript?

View 2 Replies View Related

Change Text/href Of A Link With JavaScript?

Mar 25, 2001

I was wondering if I could change the text of a link with a JavaScript. I want to set it up with a JavaScript function so that when A link is clicked on, the text of that link changes and it points to a different function.

View 2 Replies View Related

Mouseover Javascript To Change Content In A Table

May 4, 2005

I have a company that has a group of companies under it. I plan to add 4 company logos on one front page, and when the user mouses over one of the logos, I want a table below to change and show a description of that company.

The images that they will be mousing over will also need to change, and the table that will change should be able to carry a static message such as "Hover your mouse over the logos above to find out more".

View 7 Replies View Related

JavaScript Function That Will Change XML Style Sheets

Dec 14, 2007

I've been trying to make a Firefox extension and I am finding a need for a style sheet switcher. I have found several sites that will give you stylesheet switches for HTML, XHTML, but not XML. When I search for an XML stylesheet switcher I'm getting information on XSLT. Which I do not want to use at this time. I want the stylesheet switcher to be a JavaScript function since I know how to evoke functions with XUL menu overlays the form of XML used to create Firefox extensions. I'm not looking for somebody here to know XUL. I would just like a function which you know would work with XML to try in my XUL form of XML to see if it will work. A link that would give me this function or information on how to write it would be good to. I am a newbie to both XML and Firefox extension writing. I spent all they reading about XML hoping it would give me the answer but it didn't. I have seen some information which seems to say that XML as similar stylesheet capabilities to HTML so I know that.

View 2 Replies View Related

Using Javascript To Change Table Cell Background Image

May 15, 2003

I'm trying to be tricky and its not been working LOL. I have a gallery page with lots of thumbnails that load up. What I wanted to do was have a "LOADING IMAGE" GIF in each of the table cells so that the user would see visually how many more images were going to load up. That bit is fine but when all the thumbs have loaded I want to change that Cell background image to something else.

How would I do this? Would I be able to reference them all at once or would I have to reference each individual cell one at a time.

To better illustrate my point see this this link :

View 2 Replies View Related

Passing A URL As A Parameter

Oct 9, 2005

I have a javascript function that is called in an OnClick event for a
button.
I am attempting to get the function to open a web page in a new window
in response to a button click.

I can get the page to open if I use the following syntax (hard code the
address)

var newwin =
indow.open("http://www.w3schools.com","","width=1200height=1000");

However, If I pass the url in as a parameter to the function (as below)
the value passed in is "Undefined" and obviously the page will not open

function openThePage(url)
{ url = "http://www." + url;
var newwin = window.open(url,"","width=1200height=1000");
}

<input
class="mybutton"
type="button"
name = "W3Schools"
value="w3schools.com"
onclick="openMyUrl(W3Schools.Value)">
&nbsp;&nbsp;

Anyone any idea how I can do what I want - what I am doing wrong. I am
grey enough as it is and I don't want to start pulling my hair out.

View 1 Replies View Related

JQuery :: Get Parameter From URL?

Jun 14, 2010

I'am building a little site with jquery. Now I have a Problem. I want that if in the url ?product=anyid is, a function is called. If the url is empty and has no parameter the normal site should appear and run.This is for building a permalink to products and you can open them with [URL].

View 2 Replies View Related







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