I need a javascript function that returns the Saturday of the week for a given week day. Example if I input 2/5/2010 I get 2/6/2010 or if I put 2/10/2010 I get 2/13/2010
I am trying to finish a script that shows a particular div based on the last 2 chars in the cookie value. I have the cookie part done. how to show hide part.
I am trying to show a field based on another field's value and hide it it initially... like when you want students to select their schools if they have gone for education ortherwise the school field remains inactive...I have the folowing scipt but it is not being fired on page load...
<script type="text/javascript"> function OnPageLoadAdd(pageid) { var tName = 'dbo.Register';
I know from scouring the Web that this is a very common Javascript question, but I have a twist on the question which is giving me headaches, and I hope some of the brilliant minds here at DaniWeb can help show me the error of my ways.
Say a user has checked a checkbox when submitting a form. I have a PHP script that records that check in a MySQL record. Later when they visit the page, the PHP script shows the checkbox as being checked. That's all working fine.
Now here's what I'm TRYING to do: Since the checkbox is checked when the page loads, I want a certain div to show up. And when the user UNchecks the checkbox, I want the div to go away. Simple, right?
Here's the Javascript I've placed in the header:
In the CSS, I've styled a div thusly:
And here's what I'm doing in the <body>:
This should show up when you click Yellow Box. And it should go away when you click it again. </div>
When I uncheck the checkbox (first click), nothing happens: the div still shows up.
Then when I re-check the checkbox (second click), the div goes away.
And then when I un-check the checkbox again (third click), the div comes back.
In other words, it's doing the OPPOSITE of what I want.
It seems that when I click the checkbox the first time (to uncheck it), the Javascript pulls an empty value. Only with the second click is it finding a value ('none').
I have a script I am trying to use to show or hide a div id. It uses a cookie, set on link click, to remember if the div should be displayed or not.
It works, but I'm having two problems:
1) The function only shows/hides the first instance of the div, not all instances.
2) Reloading the page after an initial cookie set causes the div to always initially be displayed regardless of the last cookie value (cookie seems to automatically re-set itself to 'tutor-show').
Here is the code:
You can see it in action here: uomeds{dt}com/cbl/cbl-2.htm
On www.vellusiaremyhair.com/order.php I set it up so the larger image shows based on the thumbnail clicked.With JavaScript can I make that "ZOOM" link to the large version of the image that is selected?
I was wondering if you had any idea how to show a ad based on screen resolution. Sort of like how espn.com has it...when your on 800 by 600 it doesn't show the ad and msn table on the right but when you are on 1024 or higher it does. Does anyone have any idea how to do this?
I would like to show or hide a header element (e.g. <h3></h3>) based up a div tag that either contains content or not. The content is dynamically added or shown, but the header element isn't, which results in having the header element shown with no content below it many times.
I'm basically looking for script that uses hide show functionality. with the addition of save state ability based on a cookie that remembers what item the user last expanded for his/her previous visit.
In other words lets say a user expands a link that has a list of information.
Then the user leaves the page and comes back to the same page. It would be ideal if that page remembers(via cookie) what the user last expanded.
Does ANYONE... know where or can perhaps paste some sample code?
I have a script to show and hide various divs based on a function & var. The problem I am having is that when ANY of the variables ('hate', 'ok' and 'love') are passed all 3 different feedback forms ('FeedbackHate', 'FeedbackOk' and 'FeedbackLove') appear, not just the one I want.
Here is the JS: function sitesurveyswitch(emotion) { var e = emotion; document.getElementById('site_survey_hate').style.backgroundPosition = '0px 0px'; document.getElementById('site_survey_ok').style.backgroundPosition = '0px 0px'; document.getElementById('site_survey_love').style.backgroundPosition = '0px 0px'; document.getElementById('FeedbackHate').style.display = 'none'; document.getElementById('FeedbackOk').style.display = 'none'; document.getElementById('FeedbackLove').style.display = 'none'; if (e == 'hate') document.getElementById('site_survey_hate').style.backgroundPosition = '-80px 0px'; document.getElementById('FeedbackHate').style.display = 'block'; if (e == 'ok') document.getElementById('site_survey_ok').style.backgroundPosition = '-80px 0px'; document.getElementById('FeedbackOk').style.display = 'block'; if (e == 'love') document.getElementById('site_survey_love').style.backgroundPosition = '-80px 0px'; document.getElementById('FeedbackLove').style.display = 'block'; }
And here is the code related to this function: <div id="siteSurveyBox"> <span id="site_survey_hate" onclick="sitesurveyswitch('hate');return false;"></span> <span id="site_survey_ok" onclick="sitesurveyswitch('ok');return false;"></span> <span id="site_survey_love" onclick="sitesurveyswitch('love');return false;"></span> </div> <div id="FeedbackHate" style="display:none; margin-top:-28px;"> FEEDBACK FORM IS HERE </div>
<div id="FeedbackOk" style="display:none; margin-top:-28px;"> FEEDBACK FORM IS HERE </div> <div id="FeedbackLove" style="display:none; margin-top:-28px;"> FEEDBACK FORM IS HERE </div>
The following function shows a list of Counties populates by a PHP page:
I would like to now, when a user clicks on a County, they are shown a list of pubs based on that County (so, I'll create a new PHP page WHERE County = 'County' or something?)
At the moment, when a user clicks on a County this function is passed:
So, passing a value through so I can modify the SQL in the PHP page to filter the counties?
I have this java function that will show the div based on whatever u select. Each div is a different set of form fields. My problem is if you change 1/2 and go to the other selection, it'll submit BOTH. not just the one you currently switched to. So if i can modify this fucntion to add the ability to either clear the divs not being used (will a clear'd div still submit data?), or reset.fields (would that do it?).
I have a simple jQuery code that shows or hides a DIV based on the selected value of a select tag. Currently it looks like this and it's working fine: if (selected == "0") jQuery("#divPublishDate").show('slow') I want to add an else so that the if the value is anything other than 0, I want to hide the div. What's the proper syntax in this case? I assume this is the short version of an IF statement without the { }.
I've got a fixed div that has a fixed tab as a trigger. I'd like to only show the trigger tab when the user scrolls down the page "X" pixels from the top (say like 200px). Can someone point me in the direction of implementing this?
I have a list of about 20 check boxes and I want a div to show when 3 have been selected as "Yes" option, how do i go about doing this?
Here is my html code:
<form> <ul id="quiz-list"> <li>1. My bed partner complains that I snore. <input id="select1" name="snore" type="radio" value="Yes" class="static_class style1" />Yes
It shows an input field when the select value is "dropped". The problem I am having is that if I select "dropped" it will display the input field, but if i select a different value AFTER selecting "dropped" the input field is sill displaying. How would I get it to hide the input field if it is NOT selected?
I have very little knowledge of javascript, other than modifying existing scripts, and I can't find anything about this particular problem. creating a simple script that will display a div ONLY if the user comes from a certain page within the same site.
Not sure if that was clear, but let me try with specifics. There is a link to a page called 'Clients' on the 'About Us' page. If a user goes directly to 'Clients', they should have a normal experience. If, however, they come via the 'About Us' page, I want to display a div at the bottom of the page that will take them back to the 'About Us' page.
I know how to get a referrer, and I know how to show/hide divs. I just don't know how to combine the two.
I have a select box where the value must be passed via the form. If the users selects choice B or Choice C then I want a specific div to show. If they choose choice A then I want the div to hide or remain hidden. It should be hidden on page load.
Ok so I have a select box where the value must be passed via the form. If the users selects choice B or Choice C then I want a specific div to show. If they choose choice A then I want the div to hide or remain hidden. It should be hidden on page load.
If the first radio button is selected, I only want all three buttons to be visible to the user.
If the second radio button is selected, I only want the "Edit Data" and "View Data" buttons to be visible.
If the third radio button is selected, I only want the "View Data" button to be visible.
Is it possible to accomplish this in Javascript? In particular, I want to continue using the "input type=submit" buttons without having to create my own.