Second OnClick Not Working - Page With A Div That Is Hidden Until Clicked On
Apr 23, 2010
I have a page with a div that is hidden until clicked on, and can be hidden if clicked on again (at least that is the goal).
The html looks like:
HTML Code:
I currently have the following javascript:
Code:
My goal being to click on the main <div> and show the content in the <span> and change the image, and then clicking again returns it to it's original (hidden) state. I have been able to successfully show the <div> but can't get it to hide again. And when troubleshooting it using Firebug it shows that clicking on the <div> is simply removing the class that hides it, leaving no class, and definately not replacing it like I am trying to do. Any ideas why the second click is not producing ANY results? Also, if I get it working I have thought that by making the entire <div> have the onClick handler if someone tries to click inside the unhidden <span> (for links or to click in a search box) would result in hiding the <span> rather than following the link or focusing on the input box. Is there any possibility for that?
The main reason handled the <div> is because there will be multiple sections that I would like to reuse the function on, and creating an id for the <div> and then referencing this.id was the first way I was able to get the functionality that I currently have.
View 2 Replies
ADVERTISEMENT
Jan 10, 2010
right now im using a percent bar to redirect the page when all buttons are clicked but i want a more efficient way of doing the redirect there will be a total number of buttons on my page, for examply 5 every time one is clicked, is there a possible way of subtracting 1 and when buttons = 0 the page redirects
View 1 Replies
View Related
Jul 22, 2011
So I just finished developing a big app in FF, Chrome adn Safari where everything works great. I switched to IE expecting maybe a few bugs, but almost NONE of my jQuery works. Just to test I put together a simple page to test basic jQuery and it still doesn't work:
[Code]...
I just have a hidden div on my page and want to show it and it doesn't work.
View 7 Replies
View Related
Apr 14, 2011
Here is some sample code from my html page:
<script language="javascript" type="text/javascript">
function setProperties(formElement)
{
formElement.form.elements["customerID"].value=1;
alert(formElement.form.elements["customerID"].value);
}
</script>
There are two submit buttons and I would like to change the hidden field value for one of the buttons when it is clicked. I have tried various ways to assign a value to the hidden field in the javascript but none of them works including the above. I have tried "formElement.form.customerID.value", "formElement.form.getElementById "customerID"); etc but it does not work. What is the right way of assigning the hidden field value in javascript.
View 1 Replies
View Related
May 2, 2011
I am trying to use it to direct users to a search page based on the values of two drop down boxes. The issue i am having is that the code below works fine on a test page, but not on my test domain (with wordpress theme) and so i was wondering whether there is anything I am doing wrong... Is onclick already defined maybe? I'm not sure how it works to be honest... :(
<script type="text/javascript">
function gosearch() {
var breed = document.getElementById('breed').value;
var area = document.getElementById('area').value;
var site = "http://hairloss-help.net/?s=";
var searchurl = site + breed + area;
[Code]...
View 7 Replies
View Related
Nov 2, 2009
The <a> is a list of menu items that when clicked.... a specific gallery-slider-images should been shown in relation to the galleryId....<div class"gallery" is hidden in CSS> I'd like to use jQuery to complete this task if at all possible, i can't seem to .show() the selected 'gallery' w/o showing them all...........
View 1 Replies
View Related
Sep 21, 2006
I have a form with multiple submits and each one needs to set a hidden form value to a different value. I guess i can do this with an onclick, but have failed so far to discover any code that might do this.
View 1 Replies
View Related
Dec 5, 2009
I am trying to update the .onclick event after its been clicked once. Everything works fine in my script except updating the .onclick event. I have searched the web and found that I should do the following:
div.onclick = function(params);
or
div.onclick = new function(){updatedStatement};
I have tested both of these steps in IE and FF with no luck. Here is my code:
function movePhrase(OPT,MENU,ID,DIR,LEVEL){
if(DIR == "up"){
var num = OPT - 1;
}else{
var num = OPT + 1;
} .....
function newOnClcik(opt,menu,id,level,dir){
var string = "movePhrase("+opt+","+menu+","+id+",'"+dir+"',"+level+")";
return string;
}
Below is an example or the div code I am trying to update:
<div id="downImage1">
<img id="down1" src="images/downArrow.JPG" onmouseover="this.src='images/downArrowPressed.JPG'" onclick="movePhrase(1,20,331,'down',1)" onmouseout="this.src='images/downArrow.JPG'" width="40" height="40" />
</div>
View 5 Replies
View Related
Dec 26, 2011
[URL]..Default.aspx I have both a carousel with images andalso animagemap(notnot published yet)with coords that when clicked i want to write to a cookie file which image or image map coordinate was clicked, so when they are hyperlinked to the next page the correct div opens based on first reading the cookie written to on the previous page. Anybody have a basic script for reading and writing to a cookie using jquery in this fashion?
View 2 Replies
View Related
Nov 29, 2011
I have a hidden div containing a table. When the user enters a number into a text field and presses submit, the div containing the table appears. That's what is suppose to happen anyway. I am using an onclick function within the submit button to change the css display from none to block. The javascript is not executing.
Code:
How many devices do you want to register?
<input type="text" name="rows" id="rows" size="2" >
<input type="submit" name="submit" value="Enter" onclick="showRows();">
The javascript is
Code:
function showRows() {
var numRows = parseInt(document.getElementById('rows').innerHTML);
if(numRows != "") {
document.getElementById('Table').style.display = 'block';
} else {
document.getElementById('Table').style.display = 'none';
}}
Am I going about this the right way?
View 1 Replies
View Related
Mar 1, 2010
I want the hidden layer to open when the visitor clicks and stay open until they click the close x. I can get the hidden layer to show onMouseover, but not onclick.
Code:
<script type="text/javascript"> // Copyright 2006-2007 javascript-array.com var timeout= 500; var closetimer= 0; var ddmenuitem= 0; // open hidden layer function mopen(id) { // get new layer and show it ddmenuitem = document.getElementById(id);
[Code]....
I find script that does something similar and adapt it to do what I need it to do. Usually, I can work it out on my own - but I have been working on this for several days now.
View 2 Replies
View Related
Jul 9, 2009
I am reposting a question because my previous post went a bit wild and I didn't get my answer... I'll try to be more precise this time...I have a PHP page in which I query a mysql db, displaying the results in a table. For each line, I have a button that I want to click to open a new popup window and pass 2 variables to that new page. I use the onClick event. Values for these 2 variables are different for each line (each button). See code below.My question is: is there a way to pass these 2 variables and values to the popup window without displaying them in the URL?Here is the first page code:
<table width="100%" cellpadding="0" cellspacing="0">
<?
$sql = "select * from LNA_TEAMPLAYERS as A inner join LNA_PLAYERS as B on A.PLAYERID = B.ID_LNA_PLAYERS
[code]...
View 3 Replies
View Related
Jun 6, 2011
I would like to change the value of a single hidden input onclick. The possible values are text, email and URL.I've tried all kinds of "ways" (inline and in function in a variety of ways,) but nothing. I stripped it down one last time to give it another go, but realize I'm out of ideas, so the code below is simply where I've thrown in the towel.Can someone make this work with a JS function, so that each link may be clicked and change the hidden input's value to the respective value?
View 3 Replies
View Related
Oct 23, 2010
onClick="function(' whats the value of the anchor tag just clicked? Title basically says it. I need to get the object that was just clicked, to insert into a JavaScript function. I've tried "function('this')" and similar things, but it doesn't work. I'm sure this is REALLY easy to do, but I don't know it and I have no idea what to search for.
View 1 Replies
View Related
Aug 19, 2010
When you select multiple <div> get the value of each one and save in separate hidden fields accordingly.
What needs to happen is. Click div 1 --> if hidden field1 value is "none", save there, else check hidden field 2 if that's "none" save in hidden field 2
Click div 2 --> if hidden field1 value is "none", save there, else check hidden field 2 if that's "none" save in hidden field 2 Here's what I've come up with so far (currently I'm using JQuery)
The problem with this is that no matter what div I click in which order it only updates the 1st hidden field :(
[Code]...
View 1 Replies
View Related
Oct 23, 2010
I need to get the object that was just clicked, to insert into a JavaScript function. I've tried "function('this')" and similar things, but it doesn't work.
View 3 Replies
View Related
May 10, 2011
I'm just learning javascript. I need to create an onclick event for a three-state rollover. I just can't figure out where to place the event. I know it needs to go in my setup rollover function, but can't figure out where to place it so an alert pops up when one of the buttons is clicked. Anyone have any guidance for me? HTML code is (JS is below and button 1 images attached):
[Code]...
View 1 Replies
View Related
Dec 3, 2007
I have a side menu that I have added an onclick statement to, which will change the css class for that item to "selected" so that I can apply styles for the selected link. Here is what I have:
HTML Code:
<style type="text/css">
<!--
.selected {[code]....
How can I modify this so, after one selection is clicked, and you click something else, the class gets removed from the first clicked item, and is now applied to the newly clicked item? I only want the class applied to the currently clicked item, and removed when they click on another item.
View 14 Replies
View Related
May 18, 2010
I have a vertical navigation menu with the basics (a <ul> with four <li>) but I need one of these list elements to slide to the left and when it finishes show or slide down a nested <ul> with its own li that is now hidden with display: none. and when I click again the first list element I wish everything to close back. or alternatively to close with a timeout. so far I got to this:
$(document).ready(function(){
$("#gioca").click(function(){
$("#gioca").animate({ left: "+=400" }, 1200)
[code].....
View 2 Replies
View Related
Oct 26, 2009
The purpose of the code is to slideToggle open one of two hidden sub-nav bars when either of two different menu items are clicked upon - instead of a drop down menu. What doesn't work is the hiding of the div that is not required, if it is already open. Viewing in firebug shows that the appropriate classes are being applied - I suspect the reason is that slideToggle has been somehow set and cannot be unset via another object - but perhaps that is not it at all?
$(document).ready(function() {
//add .toggle function to appropriate li element
$('#hozmenu li:nth-child(4)').toggle(function () {
//set 4th menu links colour to be green whilst div is shown
$('#hozmenu li:nth-child(4) a').css('color', '#95d890');
$('#toggle_nav_services').removeClass('toggle_show');
[Code]....
View 1 Replies
View Related
Jun 2, 2009
what im trying to do here is create a dynamic hidden iframe and write a form into it and submit. this approach works in FireFox but not in IE7, below is the code im using
document.forms[form].appendChild(isProcessFQ);
var ifText = document.getElementById(rootElID).innerHTML;
var ifSubmit = document.createElement('iframe');[code]........
But when i run this in IE7 its openings a new blank window after the statement doc.open(); and shows some error(which has no useful details) and not maing any calls to server.
View 10 Replies
View Related
Aug 13, 2006
I was wanting the a to allow the user to click on it and none the display replacing the timer with a text, but i still want the timer functioning, then when they click it changes back to display the timer again. They way I have it now seems to be bringing up a new instance of the timer starting from 0 instead of changing the text, please advise me of the correct means to accomplish this feat Code:
View 3 Replies
View Related
Sep 1, 2006
brighten a page to white when a link is clicked, and then unbrighten to the new page the link sends you to.
Anyone know how to do that?
I want to make the home page be the gateway page, and if you click on any of the links, the home page fades to white really fast/smooth and then the white goes away fast and smooth revealing the link that was clicked.
View 4 Replies
View Related
Dec 4, 2010
Basically I am looking to show/hide a DIV with the click of a button.The script work accordingly in IE but fail in FF.I am sure I am the problem here.
Code:
<script type="text/javascript">
function toggle(box) {
[code]....
View 1 Replies
View Related
Aug 26, 2011
i have a form that submits into an API, and one of the fields is for where the page should redirect after a successful submission.
So i'm using Javascript to take the onpage fields and make the proper redirect URL.
This method works in Chrome, and IE - however not in firefox.
better methods for this to be valid in FF?
[Code]....
p.s - what do your javascript guys prefer i wrap my code in? CODE?
View 1 Replies
View Related
Dec 18, 2009
I have the official qQuery autocomplete plugin ( from bassistance) working properly. Start typing a product name and it queries my php script and mysql to return a list of products.
However, when the user submits the form, I want a hidden form field that contains the row ID for that product in the database table. I would have thought that this is a very common need, but I did not see any of the examples in the doc or website.
Desired query:
Code:
Desired form for submission
Code:
Code:
View 2 Replies
View Related