Display A Div Element After Clicking On A Link And Using Its Properties?

Jun 3, 2010

On a page I display a link of search results which are hyperlinks, which all have the same URL get paramaters with different values (i.e. companyreport.aspx?....). I want to then click on a search result hyperlink and then generate a Div popup (this is called through a javascript call that is attached to each search result hyperlink's onClick property.

For the hyperlink that is clicked, I need to take its 'href' value and use it (reason for us is in a bit).

On the popped up Div element is a dropdown box and two buttons (accept / decline). Once the accept button is pressed, I want to then go to the page the selected hyperlink was pointing to by using the 'href' value I obtain from the clicked search hyperlink and to also append to this hyperlink the a new GET parameter and the value of the dropdown box.

I have got this to work currently but it seems quite mess, so was wondering if there is a better solution to this.

For the search results hyperlinks I have...

Code:
PromptRequestReason(this.href); return false;

this '' javascript method is....

Code:
function PromptRequestReason(hrefLocation)
{
lnkDERequestReason.href = hrefLocation;
popup('popUpDivReason');
}

then on the DIV popup I have the following link....

Code:
<a id="lnkDERequestReason" onclick="this.href = this.href + '&reason=' + document.getElementById('drpPortfolios').value">Select</a>

now this all works, but I really seem like I am taking the long way around when there could be something simple.

View 1 Replies


ADVERTISEMENT

Display PDF Files By Clicking A Hyper Link

Jun 4, 2011

I have a project to display PDF files by clicking a hyper link. The PDF are huge in size and it will take a long time to load. I want to show a message like "Loading Please wait" on that loading time..

View 1 Replies View Related

JQuery :: Make Element Click Event By Clicking On The Other Element?

Jul 29, 2011

I`m trying to make selecting an select list option (as it become when we click on it)by clicking on a special pseudo element.I`m trying to do it in this way:

<script>
$(document).ready(function(){
$(".psevdo-checkbox").each(function(){
$(this).click(function(){

[Code].....

View 6 Replies View Related

JQuery :: Toggle State Of An Element When Clicking On Another Element?

Oct 13, 2011

I made a website in which I -for the first time- included some jquery code. I am totally new at this. I managed to have a menu, whose elements can be clicked, which triggers the apparition of a different "bubbles" with text inside. So far so good. But I would like to make a bubble disappear when I click on another element than the one that triggered its apparition. Explanation :

My menu is for example like: menu element 1 | menu element 2 It should do this

>> click on menu element 1 = bubble1 (it works) >> click on menu element 1 = bubble 1 disappears (it works) OR >> click on menu element 2 = bubble 1 disappears, bubble2 appears (doesn't work! there I have 2 bubbles at the same time)

View 9 Replies View Related

Link Tracking - Counter That Will Display Beside A Link With The Number Of Times The Same Link Has Been Clicked

Feb 16, 2009

I need a counter that will display beside a link, with the number of times the same link has been clicked. I do not have FTP access to the site, since it is based on a CMS.

View 1 Replies View Related

JQuery :: Get Link/url Properties From Within A Div?

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

Hide Popup Element When Clicking Outside The Element?

Mar 30, 2010

I have some existing code that I need to alter so that when the user clicks outside the element, the element disappears. I have looked at other show/hide element code, but I'm not sure how to integrate it with the script below.

There's a date form, with an calendar image icon. When you click on the calendar icon, a div with a calendar opens. Then you can click on the dates, that when clicked will fill out a textfield with the date.

The form code:

Code:
<div class="TSearchBox">
<div class="TSearchBoxDate">
<span class="normal TLabel">Frn: </span> <input name="TLfd" type="text" value="2010-03-30" />
<img src="images/datum.gif" class="TCalendarImage" alt=""

[Code]...

View 1 Replies View Related

Change The Display Properties Of A Class

Jul 28, 2006

can u change the display properties of elements in a certain class?

View 1 Replies View Related

Element Has No Properties.

Apr 15, 2006

I only get an error telling me "test has no properties"...

Code:

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Untitled Document</title>

<script language="javascript" type="text/javascript">

var test = document.getElementById("test");
var title = test.getAttribute("title");
alert(title);

</script>
</head>

<body>

<p id="test" title="test title">This is a test</p>

</body>
</html>

View 2 Replies View Related

Getting An Element's Style Properties?

Jun 21, 2009

I am working on a little javascript project, and I need to get an arbitrary element's style information.

For instance, I want a method that you can pass a reference to an object, and for instance, find the current css height property that applies to it, no matter where it was declared. I don't mind it returning a null value if it wasn't set anywhere, but if it's coming from some css class or some css id or some locally defined style, I want to know what is being expressed.

If I just try el.style.height, it only lets you know what the height is if it was explicitly defined in the style tag.

View 6 Replies View Related

How To Set Link's "visited" Property/pseudo-class Without Clicking On The Link

Apr 27, 2007

I would like to set the link's "visited" pseudo-class with javascript
without clicking on the link. My goal is to update the link's color
(previously set in the CSS file) to be "visited" without actually
clicking on the link and then clicking "back" in the browser.

Does anyone know how? Here are the following things I've already
tried to no avail:

var obj = document.getElementById("idOfMyLink");

//obj.visited=true; // NO
//obj.style.visited=true; // NO
//obj.click(); // NO, performs a click and takes me away from
current page

/*
// Setting the src of an iframe on the same page, trying to
"stuff" this URL into browser's "History"

var theFrame = document.getElementById("myiframe");
theFrame.src = obj.href;

// NO. The iframe does go to correct URL, but the link's color
doesn't update.*/Any ideas?

View 3 Replies View Related

Changing Properties Of Element With Function

Nov 23, 2005

Maybe a stupid question (I'm not so familiar with javascript), but:

I want to change background of a paragraph or list item on mouseover. The
following code works:

<p onMouseover="this.style.backgroundColor='yellow'"
onMouseout="this.style.backgroundColor='white'">ppppp</p>

Now I want to minimize the coding bij using a function. How do I do that?

View 12 Replies View Related

JQuery :: Changing Css Properties Of One Element By Another

Feb 10, 2011

I have a billion elements that all share the same class. I have another billion elements that all share another class. This cannot be changed. My objective is to use one element to trigger onclick a change in the others elements' css properties, that is each element is paired with another, producing a billion unique pairs. From hours of deciphering the cryptic documentation examples ive come up with the following, which doesnt work. Assume that im using "name=item#" in the element's tag to identify each pair.

One fundamental issue with this is that it will change the opacity of both elements in the pair were both elements to share a name,or it will only affect the element being clicked on if not, but i only want it to change the opacity of the element that isnt being clicked. Another issue is that there are instances where i may need to set a setTimeout on a css property, and ive not found any documentation on integrating javascript and jquery together within a function.So how do i get this function to accept input from one element and affect the css properties of the other? And what would a setTimeout look like if it were placed around the opacity property?

View 4 Replies View Related

Restore CSS Properties For A Selected Element?

Apr 14, 2010

How do I restore CSS properties for a selected element? I want to change the background-color of a particular item on click, then restore the original CSS bgcolor from the stylesheet when it's clicked a 2nd time.

The item in question has a CSS class applied to it from the stylesheet.

View 2 Replies View Related

Accessing Form Element Properties Using Onchange?

Jul 5, 2006

I have 1 form, and dozens of elements. In the select elements I use onchange="somefunc()". In this function I'd like to access and change the form element attributes (such as form.element.option[].value and form.element.option[].innerHTML).

Is there a way to access the element that has just changed (unsing onchange="somefunc()") by passing a "this.element" parameter to access the elements properties such as form.element.option[].value within the function?

View 2 Replies View Related

Accessing Element Properties After Setting InnerHTML?

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

Set Multiple Style Properties Of A Dom Element In One Time?

May 25, 2011

I know the atomic way to set style properties of a DOM element like

Is there any way to set multiple properties in the same time? I'd like to spare some cpu time...

I assume if I use framework like JQuery to set more style props at once that call will be interpreted to the atomic way I described above...

Am I right with this guess?

View 1 Replies View Related

Display The Div Tag And Its Content By Clicking It?

Sep 26, 2011

Am trying to display the div tag and its content by clicking it. the code below displays the whole source code when cliked on the div with id = softros. I want to make this script to display the div in view source format of the browser when clicked on any div.

<html>
<head>
<script>
function viewSource()
{
window.open('view-source:'+location.href);
}
[Code]....

View 2 Replies View Related

Confirmation When Clicking Link

Dec 4, 2009

I want to have a javascript popup box so that when a hyperlink is clicked, a user is asked if they are sure they want to click this link, if they select ok then the page loads, if they click canel then nothing happens, However when a user clicks cancel the link still loads, can anyone see where I am going wrong?

View 5 Replies View Related

JQuery :: Accessing Methods And Properties On An Object Of A Passed Element?

Jan 25, 2010

I have an object on the document element that allows for other components to register with it, i have a custom event something along$(document).bind("register",function(thechild)..So in the child object when they are created i call$(document).trigger("register",this);And indeed i get the DOM object. However i'm looking for the plug in object, i want to be able to call methods on the passed childobject and access it's Config.Does that make sense? How can i write a plug in that is applied to various objects that also registers itself with an 'overseer' object on the document element in such a way that i can allow that overseer object to call methods on any registered child objects?

View 2 Replies View Related

JQuery :: Update DIV When Clicking On Link

Nov 18, 2011

I have a couple of links which when clicking on them start a video. In another div with id="info" I want to give more information about the video which is playing. When you click on a new link and the video starts the information should update. The information wich is in a list item is hidden with display: none before you click on the link. My problem is that the information of the previous video is not disappearing when I start a new one. I don't know what to write to make the information of the previous video disappear.

I tried empty() and remove() but then the div id="info" shows nothing.
#info {
width: 195px;
height: 338px;
border: 2px black solid;
}
.hide {display: none;}
<script>
$(document).ready(function(){
$('#text1').click(function () {
$('#mona').show(300);
}); .....

View 12 Replies View Related

Change Some Letter When Clicking Link

Mar 10, 2009

I got a paragraph, and i want the letter of A will change to N and the letter of P will change to A when i click the link of the "click me to change the letter".

View 2 Replies View Related

Remove Referer When Clicking Link?

Mar 18, 2005

I have a pages with list of sites and when I click on links to other domains, the other domains will see the referer where I clicked from. How can I avoid the referer when clickin on links on my page? (I don't want to click new IE browser and paste the url).

View 3 Replies View Related

Reveal Contents In A Div On Clicking Link?

Apr 3, 2009

How can i reveal the contents in a div on clicking a link, like. code...

View 1 Replies View Related

Get Focus To Always Be In Certain Position On Clicking Link?

Mar 16, 2009

Does anyone know how to set the code, so that if someone clicks send on a form, and there's an error, that the form then shows in the window, (always a few pixels down from the top of the window), please ?The form is a php include on many different positions on many pages so the offsetTop will be different depending on which page it's on.

View 12 Replies View Related

Disable Image Link After Clicking

Aug 17, 2005

i've searched this forum before posting but didn't find a "clean" solution to my problem.
I have an image with a link on it:

Code:

<a href="#null" onClick="addValue('bold');"><img src="images/myimage.gif" title="Some text" alt="Some text" /></a>
which adds the value in a textarea in the same page via this function:

Code:

function addValue( val ) {

var tb = document.forms['valuesform'].elements['valuesfield'];

if ( tb.value.length > 0 ) tb.value += " , ";

tb.value += val;
}

I need to disable the link after the image has been clicked,preventing multiple insertions of the same value. I've modified the link this way:

Code:

<a href="#null" onClick="addValue('bold'); this.onclick=null;" ><img ......
but while only one click is allowed,i get many JS errors in the JSConsole like

Code:

uncaught exception etc.... and i think this is not a good sign.=

View 4 Replies View Related







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