Need To Simulate OnClick From Select Menu
May 19, 2006
I have a dropdown list:
<select name="select" class="mapMenu" onChange="JumpToIt(this)">
<option selected value="none">Select a Tool --</option>
<option value="javascript:onCreatePrintable()">Print Map</option>
<option value="javascript:onFindLatLong()">Find Lat/Long</option>
</select>
That calls a script:
<SCRIPT LANGUAGE="JavaScript">
<!--
function JumpToIt(list) {
var newPage = list.options[list.selectedIndex].value
if (newPage != "None") {
location.href=newPage
}
}
//-->
</SCRIPT>
Which in turn selects an option from the original dropdown.
Works fine except.....
The options in the select call scripts that open new browser windows,
and when this occurs popup blockers swing into action and block the new
window. When I originally had the javascript calls as plain links such
as [HREF="javascript:onCreatePrintable()"] the popup was not blocked
since it was obvious that user was clicking the link. Now that I'm
trying to save much needed space by putting these links into a
dropdown, the popup blockers are not recognizing the user selection....
I guess. I was thinking the javascript could somehow simulate an
onClick to alleviate the problem. Any suggestions?
View 1 Replies
ADVERTISEMENT
Jun 15, 2009
I have a onClick event in Javascript, What I would like to do is if a PHP variable were to be set, to trigger the Javascript onClick event. Is there a way to simulate an onClick? [URL]I have a form with some non-showing (non hidden) input fields but they show if I click a + and hide if I click -, default is hide, but if a certain PHP var were set I want to somehow simulate that + was clicked. I tried to force 'var lText' but that got the whole thing stuck in one state.
View 2 Replies
View Related
Aug 31, 2009
The following code works for Radio buttons. If I select 'No', the text field 'no1' is displayed. However, I'd like to set it up so if they select 'Permanent' in the dropdown then the 'no1' is displayed.
[Code]....
View 4 Replies
View Related
Oct 5, 2009
how to use the autocomplete jQuery plugin best to my needs. I'm looking to replace a select box with the Autocomplete plugin, but not quite sure how to accomplish this. In my select box, I have the option that is displayed is not the same as the data that is submitted.
ex: <option value="123">This is Displayed </option> However, with the autocomplete, since it is using a textbox, the values that are displayed, are submitted. Do I have to hack around using hidden fields to accomplish this type of behaviour?
View 1 Replies
View Related
Feb 25, 2009
if i have a <select> and i when i click an image i want to do an onclick event to select a specified option inside the <select> is this possible?
View 1 Replies
View Related
Jan 13, 2011
I am trying to use the Jquery selecmenu to skin dropdowns.There are extra UL LI getting formed with data "undefined" so dropdown is showing undefined in end.
View 1 Replies
View Related
Aug 18, 2010
I'm having problems with a Javascript 'Lookup' function.
Basically, I have a select menu 'Customer' which triggers a 3 JS functions, to populate 2 extra select menus.
Using IE Developer Tools, during debugging, I get this error: Expected ';' Error
This relates to either: eval(ajax_CustContact[index].response); OR eval(ajax_CostCentreContact[index].response); (it's a bit random, as sometimes it works, sometimes it doesn't)
I have tried changing the 'custid' to 'custname' to check whether it was an integer causing the problem, but had the same problem.
View 4 Replies
View Related
Oct 10, 2010
We have a list of items that each has a different quantity available. So I am going to create a multiple select menu, where they can select several different items. So, how can I make it that when they leave the field it sends all the different ones to the ajax program to build all the appropriate quantity forms?
[Code]...
View 1 Replies
View Related
Oct 27, 2007
I'd like to have a select box redirect to a different page when an option is chosen, but I'd only like to have it redirect for specified options. Most options will not do anything on click, but I'd like a couple to redirect on click.
View 7 Replies
View Related
Oct 28, 2010
I would like to create a slidedown menu similar to the one that can be seen here..[URL]...
The main points are:submenu slides down when main nav item is clicked, not on hover submenu stays open until another top level menu item is clicked, which makes the first submenu slide closed and the new submenu slide open active items in top level menu and submenu are highlighted. when a page linked to from a submenu loads, it's submenu is visible.
I'm afraid when it comes to JS/jQuery, while I'm usually capable of modifying existing plugins to fit my needs like superfish etc, I'm not able to roll my own yet. Unfortunately I can't seem to find an existing plugin that basically does what I want on this occasion..
[Code]...
View 4 Replies
View Related
Sep 16, 2009
I have a working code of 2 level horizontal tab menu....it is now onmouse over ,I want to convert it to onclick. I have taken from....
Code:
var mastertabvar=new Object()
mastertabvar.baseopacity=0
mastertabvar.browserdetect=""
function showsubmenu(masterid, id){
if (typeof highlighting!="undefined")
clearInterval(highlighting)
submenuobject=document.getElementById(id)
[Code]...
View 4 Replies
View Related
Jan 16, 2011
I seem to be stuck on one part of my code. A quick background, this is a website to showcase various photography services. First, I will layout what I have:
The Javascript for my menu (in the head section):
<script type="text/javascript">
<!--
var timeout = 200;
var closetimer = 1;
var items = 0;
function dropit(id){
canclcls();
if(items) items.style.visibility = 'hidden';
items = document.getElementById(id);
items.style.visibility = 'visible';
}function mclose()
{
if(items) items.style.visibility = 'hidden';
} .....
Now, here is what I have in the body section
<div id="menu">
<ul id="control">
<li><a href="#" onmouseover="dropit('dropone')" onmouseout="mcls()">Wedding Portfolio</a>
<div id="dropone" onmouseover="canclcls()" onmouseout="mcls()">
<a href="jamaicawed.html">Wedding in Jamaica</a>
<a href="indianwed.html">Indian Wedding</a>
</div>
</li> .....
So the only thing I can't figure out how to do is create an onclick event for one of the menu items (boudoir) that confirms that the user is comfortable being exposed to a specific (topless) type of image.
View 6 Replies
View Related
Mar 20, 2007
I am new to JavaScript and have been plugging away at it trying build a menu for site I am developing. My colleague has suggested I use Flash, which I could, but I think it is unnecessary and JavaScript is ideal for this use.
I have been building a menu that has a sub menu that appears below all of the main menu items. I have got this working and will include the code I used to do this below.
Now I want to change the button image so that it is visible which sub-menu the items that appear below belong to. Code:
which was very helpful and with some playing around I can now get my existing menu to complete part of my task. But I have 4 menu items and therefore need to use a "var" command to allow me to define different button images for different menus. Code:
View 2 Replies
View Related
Jan 27, 2009
I have these following code:
<img class="sptr" src="/picts/separator.gif" width="6" height="20" alt="">
<img class="imgbtn" src="/picts/in_image.gif" width="21" height="20" alt="" onClick="wrapText(document.getElementById('TheTextArea'),'','');">
[code]....
As you can see the image has an onclick associated with it.I want to do a similar thing with the selection of the font-size.As the action needs to occur after the client has selected the size, probably I will need "on buttun up" ( or is it onRelease ? ) this one <select name="x_size"> ?or on all the option statements ?
View 5 Replies
View Related
Jun 10, 2011
[URL]you see the Select Drop Down called: Fonts, well if you choose say Airstrip or Arial the image should change but the problem i am having is. It works in IE9 and FF but doesn't seem to work in IE7, IE8 or Google Chrome i hope someone can help here is the code:
<?php if($option['mode'] == "select"){ ?>
<select name="option[<?php echo $option['option_id']; ?>][]"id="option[<?php echo $option['option_id']; ?>]"<?php echo $option['option_value'][0]['extra']['reqd'] == '1' ? ' validate="required:true"' : ''; ?><?php echo isset($option['option_value']
[code]...
View 9 Replies
View Related
Mar 30, 2010
I am trying to
1. display a select box
2. onclick (extract the value and the text from the clicked item) in the select box and fill 2 text boxes.
<html>
<script type="text/javascript">
function disp_text()
[code]...
View 4 Replies
View Related
Jun 15, 2011
How to select all text in a cell by clicking in it ? I would like to select all text in a cell for fast copying.Copying 1 cell at a time.
View 1 Replies
View Related
Aug 17, 2011
Using onclick=window.open function in js to open a pdf file link in a new popup window. Works fine to display the file onscreen, but not if the user wants to save the file client-side to their computer. The right-hand-button context menu for the mouse will allow the user to download, but the file saved will be a html dump file for the webpage and the name of the file will be that for the webpage. Of course I can use the easy <a href> method for download links and the mouse context menu options will be as expected, but I can only use target="-blank" or target="_self". I need a popup window to open.
Could use :
oncontextmenu="alert('Left click the link to open, and then SAVE from with the pdf viewer')
to advise users how to save the file, and could use:
"javascript: void(0)"
To eliminate most mouse context menu options, so the user won't bother try. So how can I get a link to a file which can be viewed in a popup window and downloaded using mouse right-hand context menu?
View 7 Replies
View Related
Jul 6, 2009
Unfortunately I don't know a great deal about javascript. I have used some to construct a collapsible menu on this site : [URL] Unfortunately what it doesn't do is close the previously opened menu item on opening the next. I hope that makes sense. Is there a onclick behaviour I can add to the li's to close any open list items. I downloaded the files and tutorial from here: [URL]
View 2 Replies
View Related
Dec 12, 2011
I want to add a hidden field to a form, when a user checks a checkbox. Everything works fine when I select the checkbox by an id:
function addfield() {
if($('#checkbox').is(':checked')) {
$('div').parent(this).append(*hiddenfield*);
}
}
<input type="checkbox" (id="checkbox") onclick="addfield()" />
[Code]...
View 5 Replies
View Related
Aug 28, 2009
I need to be able to trigger (open) a select list when I click on adiv.I would love something like this to be possible:
<div onclick="$('select[name="menu"]').open">Click me</div>
<select name="menu" style="display:none">
<option value="option1">Option 1</option>
[code]....
View 2 Replies
View Related
Jun 28, 2009
I have made some application in JavaScript. I need some help from you friends.Whenever i click on some image i want that image should get selected. Same as we select when we drag on it with mouse. Hope u got what i mean.
View 7 Replies
View Related
Aug 4, 2009
What i want to do is replace the textbox of a form with a selectbox if a user clicks the textbox.can someone help me here with the code,as i don't code in javascript so don't really know where to start.
View 1 Replies
View Related
Jan 18, 2006
<SELECT NAME="color" CLASS="text">
<OPTION VALUE="red">Red</OPTION>
<OPTION VALUE="blue">Blue</OPTION>
<OPTION VALUE="green">Green</OPTION>
</SELECT>
<INPUT TYPE="button" CLASS="button" OnClick="self.location.href='index.php?page=page&color=((COLOR))'">
That's the code I'm basically looking for, I would show you the page - however I'm working through localhost and right now it's impractical to upload. The code I've given you gives you the required part anyway. What I want to do is where the buttons OnClick attribute refers to '((COLOR))' I want it to be whatever the select option is the the select field (red, blue or green).
For simplicity reasons as far as the coding is concerned, it'd be easier to avoid any functions.. (There's a lot of PHP, including files, etc - it'd be a hassel to get back to the head of the page :P). Also for practical reasons I'd prefer to avoid using a form with with the GET method to pass on the information.
View 1 Replies
View Related
Feb 13, 2010
I have a function that dynamically creates a new div, part of the function looks like:
root = document.getElementById('rootbox2');
var oDiv=root.appendChild(document.createElement("div"));
with(oDiv){
id=ji;
className="workshopRow";
setAttribute("attending","");
setAttribute("attending_count","0");
}
var oText = oDiv.appendChild (document.createTextNode(""));
var oDiv1=oDiv.appendChild(document.createElement("div"));
with(oDiv1){
className="workshopName";
}
var oText = oDiv1.appendChild (document.createTextNode(""));
var oSelect=oDiv1.appendChild(document.createElement("select"));
with(oSelect){
name="select_"+ji;
id="select_"+ji;
className="workshop";
onchange="calc_subtotal("+ji+")";
}
var oText = oSelect.appendChild (document.createTextNode(""));
var oOption=oSelect.appendChild(document.createElement("option"));
with(oOption){
value="12";
setAttribute("price",10);
}
What I am looking to do is add an onchange event to the select element, not sure if i have programmed it correctly but it does not seem to work.
View 2 Replies
View Related
Sep 25, 2010
I would like to know how to set another select menu based on what was select by another one example if I select water in the first select box.i would like to be able to select a type of water from the next select box.i have items in the first select box like water , wastewater, petroleum.if i select water in the first one then the second select box should have a list like brackish water,brine,fire protection.
View 9 Replies
View Related