Checkbox Selections Href Diff Pages?
Jun 2, 2010
I work in html and am minimally familiar with JS but am working with someone's code that uses form checkboxes to select options for hrefs in a decision tree. Given 5 options, selecting option1 takes you to page_x, option2 to page_y, etc. Users need option for selecting option1 AND option3, for example, to go to page_k.Is there a way in JS to take:
if(document.form1.A6.checked == true)
{
alert("A6 is selected")
[code]....
View 14 Replies
ADVERTISEMENT
Jun 15, 2011
Is there a way to make one regex to replace a space with " " and a tab with " "?
Currently I'm using two regex's with string.replace( ... ).replace( ... ), but that means it has to run through the string twice. Any way to do what I want in one regex?
View 4 Replies
View Related
Jun 17, 2011
I am in the process of developing a calculator for some of my colleagues to use. One of the variables within the calculations is called PMH. I want to determine the value of PMH based on which checkboxes are ticked. Each checkbox has a different value. If the checkbox is not ticked, then the value of each option is 1 and obviously more than one checkbox may be ticked.
I have created the checbox code:
<td><input type="checkbox" name="PMH" value="1.6" /> Smoker<br />
<input type="checkbox" name="PMH" value="0.4" /> CCF<br />
<input type="checkbox" name="PMH" value="0.5" /> Pulmonary Oedema / Cirrhosis<br />
<input type="checkbox" name="PMH" value="0.8" /> COAD<br /></td>
But I have no idea on how to calculate what I need for var PMH.
View 4 Replies
View Related
May 4, 2009
I have implemented pagination in jsp.these values will come from DB. checkboxes are there against each record.when user checks 3 records in 1st page and goes to 2nd pages and again comes back to 1st page whatever user checked previously it should be checked.how to maintain this state in javascript ?How to achieve this functionality.i need to maintain the checkbox state across multiple pages?
View 1 Replies
View Related
Jan 6, 2006
I have Declared same function and two diff javascript files and both files are included in HTML page and one more same function declared in HTML code too... So problem is that, which function will execute first, i mean function in either javascript or function in HTML Code?
View 2 Replies
View Related
Jul 14, 2010
I'm using this great plugin, but the prob for me is that all error messages have the same class added to them. due to the layout of my form, i need to be able to move some of the error messages around in diff ways. there is a way to add a diff error class to elements based on their id or class or whatever, but not sure how to do so.
View 1 Replies
View Related
Jul 14, 2011
I am trying to create a fixed crest at the top of my site that changes depending on where the viewer of the site scrolls to.
I found the following script/plugin on StackOverflow that works well for making one element fade in and fade out.
PART ONE:
function isScrolledIntoView(elem) {
var docViewTop = $(window).scrollTop();
var docViewBottom = docViewTop + $(window).height();
var elemTop = $(elem).offset().top;
[Code].....
I then duplicated part two and changed the variables to make a different div appear in this position depending on where the viewer was in the site but it did not work past the first transition. see the following link to get a better idea what I am trying to achieve.
[URL]
Is there any way I can adjust the script to make it work with multiple transitions?
View 2 Replies
View Related
Jul 12, 2010
I'm using the following code (simplified version) to call a Json file, parse it and on each iteration, create a div with an ID of "tab". I'm using this with jQuery UI .tab() to create a listing with entries which have three tabs. Anyhow, the principle seems to work except that when I examine what's happening behind the scenes using Firefox console, I see that each href in the html code produced is causing the Json function to re-fire using the href as it's url target.
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
[Code].....
View 6 Replies
View Related
Sep 27, 2009
I coded the following JavaScript:
var el = document.createElement("iframe");
el.setAttribute('id', 'ifrm');
document.body.appendChild(el);
el.setAttribute('height', 250);
[Code].....
And am putting it between <script type="text/javascript"> and </script> tags in the <body> section of my site. But, it only works in certain areas of the page.
View 6 Replies
View Related
Mar 27, 2011
I work for small drugstore and a lot of our customers are old and not good with computers. I want to make this work to make it easier for them to find what they need.
<html>
<!-- Created on: 3/24/2011 -->
<head>
<script type="text/javascript">
[Code]....
View 3 Replies
View Related
Jun 18, 2004
I'm running into a problem with having a bunch of different selected areas in my editable document in mozilla. I can't seem to get them all unselected. I can get one or two to unselect but not all of them.
This happens after I have been using comparePoint in a loop that loops through the whole document. I have used collapse on the selection I made but it leaves other text still selected. :confused: Is there a quick way to unselect all the selections in mozilla?
View 2 Replies
View Related
Apr 29, 2010
I'm sorry if this question has been answered before, but I'm a real noob trying to understand Ajax and JavaScript.
Therefore I need a (simple) explanation how to pass multiple selections from a list to my Ajax-script - if there are any simple solutions.
I'm not using any kind of framework - just plain Ajax/JS, PHP and of course HTML.
View 2 Replies
View Related
Apr 28, 2004
We have a site we are working on in which we use drop downs for easy search functions. (We also have an advanced seach which use check boxes) But... the client has been asking us if we can make a muliple selection happen from this quick search. There are only like 20 options to choose from but a scrolling text box will look awfull there.. as the drop downs work nicely.
Has anyone ever seen a muliple selection drop down? Or something like it?
View 8 Replies
View Related
Feb 25, 2011
Not a seasonsed JS user; I would like to have a number of dropdown forms on a page and have JS sum the total value up as the user makes their way down the page and selects values. I've googled the daylights out of this and come up with a proof of concept below - if I could get it to work right, I would apply to a larger page. It will live on a Sharepoint server so I can't just use PHP to handle the summing.
[Code]...
View 7 Replies
View Related
Oct 7, 2009
I have some code that has a comments box and 2 radio buttons that ask if you want to be contacted about your comments. If you select "Yes", you get another set of radio buttons that ask you to choose a method of contact. When you choose a method, that selected methods value is parsed to the top of the textarea field, placing the comment below. I pretty much have it working, however, if I enter a comment in the "Comments" field, select "Yes", then select "email" and change to "Phone Morning", it concatnates the values in the textarea box instead of replacing the contact method value while still retaining the comment entered below.Also, if at all possible, I wanted to clear only the contact method value out of the textarea field and leave only the comment when you go back and click the "No" radio button.
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
[code]...
View 1 Replies
View Related
Sep 12, 2011
My current project is available for perusal in order to assist me at: [URL]As you can see, I make it so that once the product type is selected, you can then select a wattage. This dependent drop-down works, however I want it so that when I select a value in the left-hand side (wattage), then the one on the right will offer a pre-defined value that replaces the wattage I have.
For example, a GU-10 in 'Type of Lamp' offers a 50, 35 and 20 watt bulb in 'Current Lighting Products'. In 'Energy Efficient Products', it offers 5 and 3. I wish to make a statement somewhere so that if they select 50 on the left, it selects 5 on the right. If they select 35 on the left, it select 3 on the right.
I would also like it to do multiple offers, so that if they select say, a 35 of the MR-16, I want the right hand side to offer both 5 and 3. The only way I can think of doing this is via a lot of 'IF' statements.
View 13 Replies
View Related
Jul 18, 2009
I have a javascript function that will load a CSV file in to a grid:
Code:
function load(url){
table.setURL(url);
table.request();
}
<button onClick="load('URLTONEWFILE.CSV')">Load New File</button>
This works perfectly, however I need to take it a step further to load CSV files, based on user choices from two drop down boxes. Something like this:
Code:
<form name="myform"">
<select name="mycolour">
[code]....
View 1 Replies
View Related
Mar 22, 2011
I am trying to have it save menu selections, I was thinking either cookies or storing it in the window thing but I am unsure of how to do these.
HTML Code:
<script type="text/javascript">
function setCookie(c_name,value,exdays) {
var exdate=new Date();
exdate.setDate(exdate.getDate() + exdays);
var c_value=escape(value) + ((exdays==null) ? "" : "; expires="+exdate.toUTCString());
document.cookie=c_name + "=" + c_value;
} .....
View 15 Replies
View Related
Aug 21, 2009
Is there a way to make radio button selections appear in a second popup window? Example: user selects various options from a page then clicks button to open a second window with select options showing up in list.
View 2 Replies
View Related
Apr 1, 2010
I have several <img> lines in my markup that contain an onmouseover attribute, as shown below: <img id="flowersPic" class="queue" class="queue" src="media/flowers.jpg" onmouseover="playVideo('flowers.flv'); "/> . .<img id="animalsPic" class="queue" src="media/animals.jpg" onmouseover="playVideo('animals.flv'); "/> . .<img id="waterPic" class="queue" src="media/water.jpg" onmouseover="playVideo('water.flv');"/> . .</body>I want to use jQuery to build a standard JavaScript array of just the video names in the onmouseover attribute. So for the markup above the array would be the stringsflowers.flvanimals.flvwater.flvI expect the jQuery will be something likev=$(img.queue).??????.get();but I'm really not sure what should go in the ?????? area.
View 12 Replies
View Related
May 20, 2011
I need help setting up a form, I want to do some pretty neat things: It will say: What countries do you want to visit? [FIELD] Part 1: I want that when a user starts typing into the field, it will suggest under things that match what you have typed so far, sort of like facebook search does. So I would need a list of recognized country names. Now for example imagine I was using this, and I typed in M, it would list under a max of 5 valid entries begining with M, if I typed in Me, it would list the ones begining with Me, if I typed in Mex, it would show Mexico. Now the user would have to click this drop down suggestion to choose it.Part2: I want once a user clicks on a suggestion, it will "pop under" the input box or somewhere, with a "x" beside it to remove it. The user can now type in another country, and when it is clicked it too appears as a sort of "icon" under the input box or somewhere, with an "x" beside it. Clicking the x removes the country from the current list of countries. Once he is done, he goes on to other fields and the selected countries remain visible. Once a user submits the form, I want to get only the countries that were visible to him.
**An alternative idea, if this one is too complicated, would be to have a drop list with all countries in it, and once a person clicks one, it will remain and a "+" sign will appear under it. When pressed, another dropdown menu will appear so the person can choose another country from the second drop down, etc. OFC all selected countries can have an X to remove them. Idk how to do this either. how to do something like this, where do you recommend I start? Any ideas? I tried searching but I'm not sure what to call this so I couldn't find anything in the search.
View 1 Replies
View Related
Jan 1, 2003
Just a quick 10-minute thing I whipped up out of boredom:
In Mozilla, every textarea now has:
surroundSelection(leftstr, rightstr)
and insertAtSelection(str)
methods.
In IE, you need to explicitly give textareas those methods by:
ExtendTextArea(refToTextArea)
And now that textarea has those same methods.
I see this question asked enough that I thought it might be useful enough to post this.
View 7 Replies
View Related
Apr 19, 2011
I have to create two dropdownlists that are dependent In my first select tag there are 4 selections ,,, year,quarter,month and week. and in second select it should automatically populate..If user select year from first select in second select values should be 1 to 365.. if quarter values in second select(dropdown) should be 1 to 4. if month 1 to 12 and if week is selected 1 to 7.
[Code]...
View 1 Replies
View Related
Apr 2, 2010
What I'm Looking to do is base certain options in a dropdown menu in a form off of the first selection, like this
Code:
Selection 1
Option 1
[code]....
View 1 Replies
View Related
Jul 20, 2005
I'd like to limit the number of selections a user can make in a
multiple select listbox. I have a note on the interface to say that
only x no. of items should be selected and I check the number server
side but I'd like to implement some javascript to do the same on the
client side. Ideally I'd like the javascript to work in IE5+ and
Netscape6+.
View 29 Replies
View Related
Jan 21, 2011
The animation that I envision coding with jQuery has proven too advanced for me at the moment. Might anyone know of an example that would help me achieve the below (simplified to the barest minimum to make sense):
I'm building a page that is split into two halves... the left half has six radio button choices: blue, red, green, yellow, purple, and black. The right half is empty. When a radio button is selected in the left half (for this example, I'll say "blue" is selected), I'd like a blue square to bounce (jQuery UI "easeInBounce") into a specified area on the right half. Then, if "green" is selected... the blue square that was already on the right half would fade out (jQuery "fadeOut") and then I'd like a blue square to bounce (jQuery UI "easeInBounce") into the same specified area on the right half.
Might anyone know of a demo that would allow me to code this? The demo can be similar (using different animations), but I'd like to see how it uses radio buttons to control an animation, and to check to see if there is already a target in existence... which would make the "fadeOut" necessary.
View 2 Replies
View Related