Search Results

Search found 128 results on 6 pages for 'onfocus'.

Page 4/6 | < Previous Page | 1 2 3 4 5 6  | Next Page >

  • Javascript display property

    - by Nani
    In my form I have a textbox and a calendr along with other controls asp:TextBox ID="TextBox2" runat="server" onfocus="CalOpen()" asp:TextBox asp:Calendar ID="Calendar1" runat="server" style="display:none;" onselectionchanged="Calendar1_SelectionChanged" script type="text/javascript" function CalOpen() { var cal = document.getElementById('<%=Calendar1.ClientID%>'); cal.style.display='block'; } /script protected void Calendar1_SelectionChanged(object sender, EventArgs e) { TextBox2.Text = Calendar1.SelectedDate.ToLongDateString(); Calendar1.Visible = false; } protected void ImageButton1_Click(object sender, ImageClickEventArgs e) { Calendar1.Visible = true; } For the first time it worked fine, but, 2nd time when I click TextBox2, that is, after selecting date for the first time. Broeser is throwing error"object required" I am unable to know where I went wrong. Plz help me in making my code correct. Thank You.

    Read the article

  • Set text based on Form <select> value

    - by danit
    I have the following <select> in a form: <select style="width: 100px; text-align: center;"> <option value="email">Email</option> <option value="telephone">Phone</option> </select> The default option is Email so the following <input> is show: <p class="email_form">Please supply your Email Address</p> <input onfocus="if(!this._haschanged){this.value=''};this._haschanged=true;" style="width: 270px" type="email" name="email" id="email" value="[email protected]"> However if they choose telephone I want to change the above to ask for a telephone number?

    Read the article

  • W3 Validation errors..

    - by Kyle Sevenoaks
    I have 12 errors, but some are just pure non existent. Doctype: <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> Here's the error report, but the "duplicate specification of attribute "value"" simply isn't true according to my .tpl: {textfield class="quetext" value="Epost*" onblur="if(this.value=='') this.value='Epost*';" onfocus="if(this.value=='Epost*') this.value='';"} Also, does a textarea require the attribute "rows" and "cols"? I thought that was only for tables? And I don't understand what the two errors at the end mean: Line 586, Column 80: Attribute value redefined... Please help! Thanks :) (Sorry if things chop and change, I'm working on the valdiation now, to tidy up as many errors as possible.)

    Read the article

  • jquery.validation - how to ignore default values when validating mandatory fields

    - by jack
    I am using jquery validation plugin to validate a registration form. Each text input field has instructions pre-filled as values in the input box ex: for a text-input box id='Name', the default value will be set to 'Enter Your Name'. I have pasted below sample code: <input type="text" id="Name" value="Enter Your Name" onfocus="if(this.value == 'Your Name'){this.value = '';}" type="text" class="required" onblur="if(this.value == ''){this.value='Your Name';}" size="25" /> What I need to know is how to specify in the validation rule such that the plugin throws a required field error if the input box contains either the default message or empty values. Help much appreciated.

    Read the article

  • Why is my condition onsubmit not returning false?

    - by Liso22
    After asking a couple of questions I managed to create this form. I didn't have troubles making it return false if the submitted value was 0 but I cannot make it return false when it's the string 'Cambia de ciudad". I'm sure I'm messing with the quotes or something like that. This is the form: <form role="search" method="get" action="http://chusmix.com/" onsubmit="if (document.getElementById('s')== 'Cambiá de ciudad") return false;'> <input class="ubicacion" name="s" id="s" tabindex="1" onsubmit="if ((document.getElementById('s').value.length < 4) || (document.getElementById('s')== 'Cambiá de ciudad')) return false;" onfocus="if (this.value=='Cambiá de ciudad') this.value = ''" onblur="if(this.value == '') this.value = 'Cambiá de ciudad'" type="text" maxlength="80" size="28" value="Cambiá de ciudad"> <input type="submit" id="searchsubmit" value="Buscar" /> </form> How do I make it work? Thanks

    Read the article

  • Form Field: How do I change the background on blur?

    - by Liso22
    I managed to remove the background when the user clicks on the field but I cannot restore it when it blurs! This is the field: <textarea class="question-box" style="width: 240px; background: white url('http://chusmix.com/Imagenes/contawidget.png') no-repeat 50% 50%; color: grey;" cols="12" rows="5" id="question-box-' . $questionformid . '" name="title" onblur="if(this.value == '') { this.style.color='#848484'; this.value=''this.style.background=' white url('http://chusmix.com/Imagenes/contawidget.png') no-repeat 50% 50%;e';}" onfocus="if (this.value == '') {this.style.color='#444'; this.style.background='none';}" type="text" maxlength="200" size="28"></textarea> Anyone knows what I'm doing wrong?? Thanks

    Read the article

  • Is MDI Form focused?

    - by Vercas
    I've had so much luck developing my application... until now. My application's main form is a MDI parent, and I didn't think of adding any MDI children in my tests until tonight. To my surprise, the MDI parent seems to never "get focus" now. The Focus event and the OnFocus method are never called! I mean... it appears focused but none of the in-code focusing events/methods work. Instead a MDI child reports the focus. How do I fix this?

    Read the article

  • Check if window has focus

    - by user2536244
    I need to check if the user has windows on focus, I'm currently doing this: var isonfocus=true; window.onblur = function(){ isonfocus=false; } window.onfocus = function(){ isonfocus=true; } And whenever I need to check if the user has the windows on focus I just do if(isonfocus==true). Problem: if the user loses focus before the page loads, even if I do if(isonfocus==true) it will return true, even though the window is not on focus, and defining the var to false var isonfocus=false; will do the reverse. Can someone help me? Thanks.

    Read the article

  • Javascript - Text Input Attributes

    - by bobrusha
    I need to create a form element <input disabled type="text" value="smth" /> which is disabled by default. It enables when onmouseover occures. onmouseover="this.disabled=false;" And is disabled by onmouseout onmouseout="this.disabled=true;" What I need is to check the following. If the <input> is focused then it shouldn't be disabled. And if the form element loses focus it disables. Please help me to complete the events. <input disabled type="text" value="smth" onmouseover="this.disabled=false;" onfocus="???" onblur="???" onmouseout="if(???){this.disabled=true;}" />

    Read the article

  • Submit form without page reloading

    - by Camran
    I have a classifieds website, and on the page where ads are showed, I am creating a "Send a tip to a friend" form... So anybody who wants can send a tip of the ad to some friends email-adress. I am guessing the form must be submitted to a php page right? <form name='tip' method='post' action='tip.php'> Tip somebody: <input name="tip_email" type="text" size="30" onfocus="tip_div(1);" onblur="tip_div(2);"/> <input type="submit" value="Skicka Tips"/> <input type="hidden" name="ad_id" /> </form> When submitting the form, the page gets reloaded... I don't want that... Is there any way to make it not reload and still send the mail? Preferrably without ajax or jquery... Thanks

    Read the article

  • Creating Javascript function called ReadName()

    - by user228390
    Hey guys, I want to create a form which has a text entry box where a user can enter their name and then I want a button as well. But what I want this button to have a function called ReadName() where what will happen is when the user clicks on the button it will come up with a message saying "Hello user name will appear here I have tried my self and but I don't think I am not getting what I want. Any help will be appreciated. <form> <label for="name">Name:/label> <input type="text" name="name" id="name"/> <input type="text" name="name" onfocus="ReadName()"/> </form>

    Read the article

  • Weird "?>" being displayed

    - by Jaxkr
    I have the following navigation bar script: <?php session_start(); require('includepath.inc.php'); require($include_path.'loginsysfunc.inc.php'); $current_page = $_SERVER['REQUEST_URI']; ?> <div class="navbar"> <img class="navlogo" src="logo.png"> <div class="navbutton"><a href="index.php">Home</a></div> <div class="navbutton"><a href="about.php">About</a></div> <div class="navbutton"><a href="donate.php">Donate</a></div> <?php if (loggedIn()){ ?> <div class="navusername"><a href="profile.php?user=<?php echo $_SESSION['username'];?>"><?php echo $_SESSION['username']; ?></a></div> <div class="navtoolsettings"><a href="settings.php">Settings</a></div> <div class="navtoollogout"><a href="logout.php">Log out</a> <?php } elseif ($current_page == '/login.php') { ?> <div class="navregister"><a href="register.php">Register</a></div> <?php } else { ?> <div class="navusername"><a href="login.php">Log in</a></div> <?php } ?> </div> For some reason, a strange "?" is being displayed. I am super confused, so please help. Here is includepath.inc.php (the only I reason it's there is because I am on a shared host, and I don't want to type '/home/bigdumbhash/public_html/include' everytime. But, here it is: <?php $include_path = '/home/a6595899/public_html/include/'; ?> Here is loginsysfunc.inc.php. These are functions that go with my login system to save time: <?php function valUser() { session_regenerate_id(); $_SESSION['valid'] = true; $_SESSION['username'] = $userid; echo '<meta http-equiv="refresh" content="0;URL=\'index.php\'">'; } function loggedIn() { if($_SESSION['valid'] == true) { return true; } else { return false; } } function createSalt() { $string = $string = md5(uniqid(rand(), true)); return substr($string, 0, 3); } function logout() { $_SESSION = array(); session_destroy(); echo '<meta http-equiv="refresh" content="0;URL=\'index.php\'">'; } ?> Here is the actual HTML of the page: <!DOCTYPE html> <html> <head> <link href="style.css" rel="stylesheet" type="text/css"> <title> Log in </title> </head> <body> <div class="navbar"> <img class="navlogo" src="logo.png"> <div class="navbutton"><a href="index.php">Home</a></div> <div class="navbutton"><a href="about.php">About</a></div> <div class="navbutton"><a href="donate.php">Donate</a></div> <div class="navregister"><a href="register.php">Register</a></div> </div> ?> <div class="loginbox"> <h1>Log in</h1> <form action="logingo.php" method="POST"> <input class="userpass" type="text" name="username" value="Username" onFocus="this.value='';"> <br> <input class="userpass" type="password" name="password" value="Password" onFocus="this.value='';"> <br> <input class="loginbutton" type="submit" value="Log in!"> </form> </div> </body> </html>

    Read the article

  • Why won't Javascript assembled Iframe load in IE6 over HTTPS although it will over HTTP?

    - by Lauren
    The issue: The iframe won't load inside the tags on the review and submit page here: https://checkout.netsuite.com/s.nl/c.659197/sc.4/category.confirm/.f Login:[email protected] pass:test03 To produce problem: - Where it says "Your Third Party Shipper Numbers (To enter one, click here.)", click "here" to see the form that won't load in IE6. It seems to load in every other modern browser. The same form works fine on this page (you have to click on the "order sample" button to see the link to the same form): http://www.avaline.com/R3000_3 Here's the HTML: <div style="border-color: rgb(255, 221, 221);" id="itmSampl"> <div id="placeshipnum" style="display: none;"></div> <div id="sampAdd"> <strong>Your Third Party Shipper Numbers</strong> (To enter one, click <a rel="nofollow" href="javascript:;" onclick="enterShipNum()">here</a>.) <ul style="list-style: none outside none; padding-left: 20px;"> <li><span class="bold">UPS #</span>: 333333</li> <li><span class="bold">FedEx #</span>: 777888999</li> </ul> </div> </div> Upon clicking the "to enter one, click here" link this is the iframe HTML in all browsers except IE6 (in IE6, the "shipnum" div element is assembled, but that's it): <div id="placeshipnum" style="display: block;"> <div id="shipnum" style="background: none repeat scroll 0% 0% rgb(255, 255, 255);"> <div class="wrapper-x"> <a title="close window" class="linkfooter" href="javascript:;" onclick="enterShipNum()"> <img height="11" width="11" alt="close window" src="/c.659197/site/av-template/x-image-browser.gif"> </a> </div> <iframe scrolling="no" height="240" frameborder="0" width="190" src="https://forms.netsuite.com/app/site/crm/externalleadpage.nl?compid=659197&amp;formid=56&amp;h=9b260d2f9bca0fd9c300&amp;[email protected]&amp;firstname=Test&amp;lastname=Account&amp;ck=Q1BnzaRXAe_RfjhE&amp;vid=Q1BnzaRXAd3Rfik7&amp;cktime=87919&amp;cart=5257&amp;promocode=SAMPLE&amp;chrole=1014&amp;cjsid=0a0102621f435ef0d0d4b3cd49ab8b2db4e253c671eb" allowtransparency="true" border="0" onload="hideShipLoadImg()" style="display: block;"></iframe></div></div> This is the relevant Javascript: // Allow for shipper number update var shipNumDisplay=0; function enterShipNum() { if (shipNumDisplay == 0){ //odrSampl(); document.getElementById('placeshipnum').style.display="block"; document.getElementById('placeshipnum').innerHTML='<div id="shipnum"><div class="wrapper-x"> <a onclick="enterShipNum()" href="javascript:;" class="linkfooter" title="close window"> <img height="11" width="11" src="/c.659197/site/av-template/x-image-browser.gif" alt="close window" /> </a> </div><iframe onload="hideShipLoadImg()" scrolling="no" height="240" frameborder="0" width="190" border="0" allowtransparency="true" src="https://forms.netsuite.com/app/site/crm/externalleadpage.nl?compid=659197&formid=56&h=9b260d2f9bca0fd9c300&[email protected]&firstname=Test&lastname=Account&ck=Q1BnzaRXAe_RfjhE&vid=Q1BnzaRXAd3Rfik7&cktime=87919&cart=5257&promocode=SAMPLE&chrole=1014&cjsid=0a0102621f435ef0d0d4b3cd49ab8b2db4e253c671eb"></iframe></div>'; shipNumDisplay=1; } else { document.getElementById('placeshipnum').style.display="none"; document.getElementById('shipnum').parentNode.removeChild(document.getElementById('shipnum')); shipNumDisplay=0; } } function hideShipLoadImg(){ var shipiframe= document.getElementById('shipnum').getElementsByTagName('iframe')[0]; shipiframe.style.display = 'block'; shipiframe.parentNode.style.background = '#fff'; } This is most of the form inside the iframe although I don't think it's relevant: <form style="margin: 0pt;" onsubmit="return ( window.isinited &amp;&amp; window.isvalid &amp;&amp; save_record( true ) )" action="/app/site/crm/externalleadpage.nl" enctype="multipart/form-data" method="POST" name="main_form" id="main_form"> <div class="field name"> <label for="firstname">First Name <span class="required">*</span></label> <span class="input" id="firstname_fs"><span class="input" id="firstname_val">Test</span></span><input type="hidden" id="firstname" name="firstname" value="Test" onchange="nlapiFieldChanged(null,'firstname');"> </div> <div class="field name"> <label for="lastname">Last Name <span class="required">*</span></label> <span class="input" id="lastname_fs"><span class="input" id="lastname_val">Account</span></span><input type="hidden" id="lastname" name="lastname" value="Account" onchange="nlapiFieldChanged(null,'lastname');"> </div> <div id="ups" class="field"> <label for="custentity4">UPS # </label> <span id="custentity4_fs" style="white-space: nowrap;"><input type="text" id="custentity4" onblur="if (this.checkvalid == true) {this.isvalid=(validate_field(this,'text',false,false) &amp;&amp; nlapiValidateField(null,'custentity4'));} if (this.isvalid == false) { selectAndFocusField(this); return this.isvalid;}" name="custentity4" size="25" onfocus="if (this.isvalid == true || this.isvalid == false) this.checkvalid=true;" onchange="setWindowChanged(window, true);this.isvalid=(validate_field(this,'text',true,false) &amp;&amp; nlapiValidateField(null,'custentity4'));this.checkvalid=false;if (this.isvalid) {nlapiFieldChanged(null,'custentity4');;}if (this.isvalid) this.isvalid=validate_textfield_maxlen(this,6,true,true);if (!this.isvalid) { selectAndFocusField(this);}return this.isvalid;" class="input" maxlength="6"></span> </div> <div id="fedex" class="field"> <label for="custentity9">FedEx # </label> <span id="custentity9_fs" style="white-space: nowrap;"><input type="text" id="custentity9" onblur="if (this.checkvalid == true) {this.isvalid=(validate_field(this,'text',false,false) &amp;&amp; nlapiValidateField(null,'custentity9'));} if (this.isvalid == false) { selectAndFocusField(this); return this.isvalid;}" name="custentity9" size="25" onfocus="if (this.isvalid == true || this.isvalid == false) this.checkvalid=true;" onchange="setWindowChanged(window, true);this.isvalid=(validate_field(this,'text',true,false) &amp;&amp; nlapiValidateField(null,'custentity9'));this.checkvalid=false;if (this.isvalid) {nlapiFieldChanged(null,'custentity9');;}if (this.isvalid) this.isvalid=validate_textfield_maxlen(this,9,true,true);if (!this.isvalid) { selectAndFocusField(this);}return this.isvalid;" class="input" maxlength="9"></span> </div> <div class="field hidden"><input type="hidden" id="email" name="email" value="[email protected]"></div> <div class="field"><label class="submit" for="submitbutton"><span class="required">*</span> Indicates required fields.</label></div> <input type="submit" id="submitbutton" value="submit"> <!-- REQUIRED HIDDEN FIELDS FOR HTML ONLINE FORM --> <input type="hidden" value="659197" name="compid"><input type="hidden" value="56" name="formid"><input type="hidden" value="" name="id"><input type="hidden" value="9b260d2f9bca0fd9c300" name="h"><input type="hidden" value="-1" name="rectype"><input type="hidden" value="" name="nlapiPI"><input type="hidden" value="" name="nlapiSR"><input type="hidden" value="ShipValidateField" name="nlapiVF"><input type="hidden" value="" name="nlapiFC"><input type="hidden" value="/app/site/crm/externalleadpage.nl?compid=659197&amp;formid=56&amp;h=9b260d2f9bca0fd9c300&amp;[email protected]&amp;firstname=Test&amp;lastname=Account&amp;ck=Q1BnzaRXAe_RfjhE&amp;vid=Q1BnzaRXAd3Rfik7&amp;cktime=87919&amp;cart=5257&amp;promocode=SAMPLE&amp;chrole=1014&amp;cjsid=0a0102621f435ef0d0d4b3cd49ab8b2db4e253c671eb" name="whence"><input type="hidden" name="submitted"> <iframe height="0" style="visibility: hidden;" name="server_commands" id="server_commands" src="javascript:false"></iframe> <!-- END OF REQUIRED HIDDEN FIELDS FOR HTML ONLINE FORM --> </form>

    Read the article

  • Convert flyout menu to respond onclick vs mouseover

    - by Scott B
    The code below creates a nifty flyout menu action on a nested list item sequence. The client has called and wants the change the default behavior in which the flyouts are triggered by mouseover, so that you have to click to trigger a flyout. Ideally, I would just like to modify this code so that you click on a small icon (plus/minus) that sits to the right of the menu item if it has child menus. Can someone give me a bit of guidance on what bits I'd need to change to accomplish this? /* a few sniffs to circumvent known browser bugs */ var sUserAgent = navigator.userAgent.toLowerCase(); var isIE=document.all?true:false; var isNS4=document.layers?true:false; var isOp=(sUserAgent.indexOf('opera')!=-1)?true:false; var isMac=(sUserAgent.indexOf('mac')!=-1)?true:false; var isMoz=(sUserAgent.indexOf('mozilla/5')!=-1&&sUserAgent.indexOf('opera')==-1&&sUserAgent.indexOf('msie')==-1)?true:false; var isNS6=(sUserAgent.indexOf('netscape6')!=-1&&sUserAgent.indexOf('opera')==-1&&sUserAgent.indexOf('msie')==-1)?true:false; var dom=document.getElementById?true:false; /* sets time until menus disappear in milliseconds */ var iMenuTimeout=1500; var aMenus=new Array; var oMenuTimeout; var iMainMenusLength=0; /* the following boolean controls the z-index property if needed */ /* if is only necessary if you have multiple mainMenus in one file that are overlapping */ /* set bSetZIndeces to true (either here or in the HTML) and the main menus will have a z-index set in descending order so that preceding ones can overlap */ /* the integer iStartZIndexAt controls z-index of the first main menu */ var bSetZIndeces=true; var iStartZIndexAt=1000; var aMainMenus=new Array; /* load up the submenus */ function loadMenus(){ if(!dom)return; var aLists=document.getElementsByTagName('ul'); for(var i=0;i<aLists.length;i++){ if(aLists[i].className=='navMenu')aMenus[aMenus.length]=aLists[i]; } var aAnchors=document.getElementsByTagName('a'); var aItems = new Array; for(var i=0;i<aAnchors.length;i++){ // if(aAnchors[i].className=='navItem')aItems[aItems.length] = aAnchors[i]; aItems[aItems.length] = aAnchors[i]; } var sMenuId=null; var oParentMenu=null; var aAllElements=document.body.getElementsByTagName("*"); if(isIE)aAllElements=document.body.all; /* loop through navItem and navMenus and dynamically assign their IDs */ /* each relies on it's parent's ID being set before it */ for(var i=0;i<aAllElements.length;i++){ if(aAllElements[i].className.indexOf('x8menus')!=-1){ /* load up main menus collection */ if(bSetZIndeces)aMainMenus[aMainMenus.length]=aAllElements[i]; } // if(aAllElements[i].className=='navItem'){ if(aAllElements[i].tagName=='A'){ oParentMenu = aAllElements[i].parentNode.parentNode; if(!oParentMenu.childMenus) oParentMenu.childMenus = new Array; oParentMenu.childMenus[oParentMenu.childMenus.length]=aAllElements[i]; if(aAllElements[i].id==''){ if(oParentMenu.className=='x8menus'){ aAllElements[i].id='navItem_'+iMainMenusLength; //alert(aAllElements[i].id); iMainMenusLength++; }else{ aAllElements[i].id=oParentMenu.id.replace('Menu','Item')+'.'+oParentMenu.childMenus.length; } } } else if(aAllElements[i].className=='navMenu'){ oParentItem = aAllElements[i].parentNode.firstChild; aAllElements[i].id = oParentItem.id.replace('Item','Menu'); } } /* dynamically set z-indeces of main menus so they won't underlap */ for(var i=aMainMenus.length-1;i>=0;i--){ aMainMenus[i].style.zIndex=iStartZIndexAt-i; } /* set menu item properties */ for(var i=0;i<aItems.length;i++){ sMenuId=aItems[i].id; sMenuId='navMenu_'+sMenuId.substring(8,sMenuId.lastIndexOf('.')); /* assign event handlers */ /* eval() used here to avoid syntax errors for function literals in Netscape 3 */ eval('aItems[i].onmouseover=function(){modClass(true,this,"activeItem");window.clearTimeout(oMenuTimeout);showMenu("'+sMenuId+'");};'); eval('aItems[i].onmouseout=function(){modClass(false,this,"activeItem");window.clearTimeout(oMenuTimeout);oMenuTimeout=window.setTimeout("hideMenu(\'all\')",iMenuTimeout);}'); eval('aItems[i].onfocus=function(){this.onmouseover();}'); eval('aItems[i].onblur=function(){this.onmouseout();}'); //aItems[i].addEventListener("keydown",function(){keyNav(this,event);},false); } var sCatId=0; var oItem; for(var i=0;i<aMenus.length;i++){ /* assign event handlers */ /* eval() used here to avoid syntax errors for function literals in Netscape 3 */ eval('aMenus[i].onmouseover=function(){window.clearTimeout(oMenuTimeout);}'); eval('aMenus[i].onmouseout=function(){window.clearTimeout(oMenuTimeout);oMenuTimeout=window.setTimeout("hideMenu(\'all\')",iMenuTimeout);}'); sCatId=aMenus[i].id; sCatId=sCatId.substring(8,sCatId.length); oItem=document.getElementById('navItem_'+sCatId); if(oItem){ if(!isOp && !(isMac && isIE) && oItem.parentNode)modClass(true,oItem.parentNode,"hasSubMenu"); else modClass(true,oItem,"hasSubMenu"); /* assign event handlers */ eval('oItem.onmouseover=function(){window.clearTimeout(oMenuTimeout);showMenu("navMenu_'+sCatId+'");}'); eval('oItem.onmouseout=function(){window.clearTimeout(oMenuTimeout);oMenuTimeout=window.clearTimeout(oMenuTimeout);oMenuTimeout=window.setTimeout(\'hideMenu("navMenu_'+sCatId+'")\',iMenuTimeout);}'); eval('oItem.onfocus=function(){window.clearTimeout(oMenuTimeout);showMenu("navMenu_'+sCatId+'");}'); eval('oItem.onblur=function(){window.clearTimeout(oMenuTimeout);oMenuTimeout=window.clearTimeout(oMenuTimeout);oMenuTimeout=window.setTimeout(\'hideMenu("navMenu_'+sCatId+'")\',iMenuTimeout);}'); //oItem.addEventListener("keydown",function(){keyNav(this,event);},false); } } } /* this will append the loadMenus function to any previously assigned window.onload event */ /* if you reassign this onload event, you'll need to include this or execute it after all the menus are loaded */ function newOnload(){ if(typeof previousOnload=='function')previousOnload(); loadMenus(); } var previousOnload; if(window.onload!=null)previousOnload=window.onload; window.onload=newOnload; /* show menu and hide all others except ancestors of the current menu */ function showMenu(sWhich){ var oWhich=document.getElementById(sWhich); if(!oWhich){ hideMenu('all'); return; } var aRootMenus=new Array; aRootMenus[0]=sWhich var sCurrentRoot=sWhich; var bHasParentMenu=false; if(sCurrentRoot.indexOf('.')!=-1){ bHasParentMenu=true; } /* make array of this menu and ancestors so we know which to leave exposed */ /* ex. from ID string "navMenu_12.3.7.4", extracts menu levels ["12.3.7.4", "12.3.7", "12.3", "12"] */ while(bHasParentMenu){ if(sCurrentRoot.indexOf('.')==-1)bHasParentMenu=false; aRootMenus[aRootMenus.length]=sCurrentRoot; sCurrentRoot=sCurrentRoot.substring(0,sCurrentRoot.lastIndexOf('.')); } for(var i=0;i<aMenus.length;i++){ var bIsRoot=false; for(var j=0;j<aRootMenus.length;j++){ var oThisItem=document.getElementById(aMenus[i].id.replace('navMenu_','navItem_')); if(aMenus[i].id==aRootMenus[j])bIsRoot=true; } if(bIsRoot && oThisItem)modClass(true,oThisItem,'hasSubMenuActive'); else modClass(false,oThisItem,'hasSubMenuActive'); if(!bIsRoot && aMenus[i].id!=sWhich)modClass(false,aMenus[i],'showMenu'); } modClass(true,oWhich,'showMenu'); var oItem=document.getElementById(sWhich.replace('navMenu_','navItem_')); if(oItem)modClass(true,oItem,'hasSubMenuActive'); } function hideMenu(sWhich){ if(sWhich=='all'){ /* loop backwards b/c WinIE6 has a bug with hiding display of an element when it's parent is already hidden */ for(var i=aMenus.length-1;i>=0;i--){ var oThisItem=document.getElementById(aMenus[i].id.replace('navMenu_','navItem_')); if(oThisItem)modClass(false,oThisItem,'hasSubMenuActive'); modClass(false,aMenus[i],'showMenu'); } }else{ var oWhich=document.getElementById(sWhich); if(oWhich)modClass(false,oWhich,'showMenu'); var oThisItem=document.getElementById(sWhich.replace('navMenu_','navItem_')); if(oThisItem)modClass(false,oThisItem,'hasSubMenuActive'); } } /* add or remove element className */ function modClass(bAdd,oElement,sClassName){ if(bAdd){/* add class */ if(oElement.className.indexOf(sClassName)==-1)oElement.className+=' '+sClassName; }else{/* remove class */ if(oElement.className.indexOf(sClassName)!=-1){ if(oElement.className.indexOf(' '+sClassName)!=-1)oElement.className=oElement.className.replace(' '+sClassName,''); else oElement.className=oElement.className.replace(sClassName,''); } } return oElement.className; /* return new className */ } //document.body.addEventListener("keydown",function(){keyNav(event);},true); function setBubble(oEvent){ oEvent.bubbles = true; } function keyNav(oElement,oEvent){ alert(oEvent.keyCode); window.status=oEvent.keyCode; return false; }

    Read the article

  • 403 error after adding javascript to masterpage for sharepoint.

    - by Jeremy
    I am attempting to add highslide-with-html.js from http://highslide.com/ to my masterpage. I am receiving a 403 forbidden error when I use the provided masterpage. I have placed it in C:\Program Files\Common Files\Microsoft Shared\web server extensions\12\TEMPLATE\LAYOUTS\1033. Test javascript files such as pirate.js which consists solely of alert("Arr!"); have loaded from the same directory. I have provided the code for the masterpage. When I do not reference the problem javascript file there is no 403 error. <%@ Master language="C#" %> <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> <%@ Import Namespace="Microsoft.SharePoint" %> <%@ Register Tagprefix="SPSWC" Namespace="Microsoft.SharePoint.Portal.WebControls" Assembly="Microsoft.SharePoint.Portal, Version=12.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c" %> <%@ Register Tagprefix="SharePoint" Namespace="Microsoft.SharePoint.WebControls" Assembly="Microsoft.SharePoint, Version=12.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c" %> <%@ Register Tagprefix="WebPartPages" Namespace="Microsoft.SharePoint.WebPartPages" Assembly="Microsoft.SharePoint, Version=12.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c" %> <%@ Register Tagprefix="PublishingWebControls" Namespace="Microsoft.SharePoint.Publishing.WebControls" Assembly="Microsoft.SharePoint.Publishing, Version=12.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c" %> <%@ Register Tagprefix="PublishingNavigation" Namespace="Microsoft.SharePoint.Publishing.Navigation" Assembly="Microsoft.SharePoint.Publishing, Version=12.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c" %> <%@ Register TagPrefix="wssuc" TagName="Welcome" src="~/_controltemplates/Welcome.ascx" %> <%@ Register TagPrefix="wssuc" TagName="DesignModeConsole" src="~/_controltemplates/DesignModeConsole.ascx" %> <%@ Register TagPrefix="PublishingVariations" TagName="VariationsLabelMenu" src="~/_controltemplates/VariationsLabelMenu.ascx" %> <%@ Register Tagprefix="PublishingConsole" TagName="Console" src="~/_controltemplates/PublishingConsole.ascx" %> <%@ Register TagPrefix="PublishingSiteAction" TagName="SiteActionMenu" src="~/_controltemplates/PublishingActionMenu.ascx" %> <html dir="<%$Resources:wss, multipages_direction_dir_value %>" runat="server" __expr-val-dir="ltr"> <head runat="server"> <meta name="GENERATOR" content="Microsoft SharePoint"> <meta http-equiv="Content-Type" content="text/html; charset=utf-8"> <meta http-equiv="Expires" content="0"> <SharePoint:RobotsMetaTag runat="server" __designer:Preview="" __designer:Values="&lt;P N='InDesign' T='False' /&gt;&lt;P N='ID' T='ctl00' /&gt;&lt;P N='Page' ID='1' /&gt;&lt;P N='TemplateControl' ID='2' /&gt;&lt;P N='AppRelativeTemplateSourceDirectory' R='-1' /&gt;"/> <title id="onetidTitle"> <asp:ContentPlaceHolder id="PlaceHolderPageTitle" runat="server"/> </title> <Sharepoint:CssLink runat="server" __designer:Preview="&lt;link rel=&quot;stylesheet&quot; type=&quot;text/css&quot; href=&quot;/Style%20Library/en-US/Core%20Styles/Band.css&quot;/&gt; &lt;link rel=&quot;stylesheet&quot; type=&quot;text/css&quot; href=&quot;/Style%20Library/en-US/Core%20Styles/controls.css&quot;/&gt; &lt;link rel=&quot;stylesheet&quot; type=&quot;text/css&quot; href=&quot;/Style%20Library/zz1_blue.css&quot;/&gt; &lt;link rel=&quot;stylesheet&quot; type=&quot;text/css&quot; href=&quot;/_layouts/1033/styles/core.css&quot;/&gt; " __designer:Values="&lt;P N='InDesign' T='False' /&gt;&lt;P N='ID' T='ctl01' /&gt;&lt;P N='Page' ID='1' /&gt;&lt;P N='TemplateControl' ID='2' /&gt;&lt;P N='AppRelativeTemplateSourceDirectory' R='-1' /&gt;"/> <!--Styles used for positioning, font and spacing definitions--> <SharePoint:CssRegistration name="<% $SPUrl:~SiteCollection/Style Library/~language/Core Styles/Band.css%>" runat="server" __designer:Preview="&lt;link rel=&quot;stylesheet&quot; type=&quot;text/css&quot; href=&quot;/Style%20Library/en-US/Core%20Styles/Band.css&quot;/&gt; " __designer:Values="&lt;P N='Name' Bound='True' T='SPUrl:~SiteCollection/Style Library/~language/Core Styles/Band.css' /&gt;&lt;P N='InDesign' T='False' /&gt;&lt;P N='ID' T='ctl02' /&gt;&lt;P N='Page' ID='1' /&gt;&lt;P N='TemplateControl' ID='2' /&gt;&lt;P N='AppRelativeTemplateSourceDirectory' R='-1' /&gt;"/> <SharePoint:CssRegistration name="<% $SPUrl:~sitecollection/Style Library/~language/Core Styles/controls.css %>" runat="server" __designer:Preview="&lt;link rel=&quot;stylesheet&quot; type=&quot;text/css&quot; href=&quot;/Style%20Library/en-US/Core%20Styles/controls.css&quot;/&gt; " __designer:Values="&lt;P N='Name' Bound='True' T='SPUrl:~sitecollection/Style Library/~language/Core Styles/controls.css' /&gt;&lt;P N='InDesign' T='False' /&gt;&lt;P N='ID' T='ctl03' /&gt;&lt;P N='Page' ID='1' /&gt;&lt;P N='TemplateControl' ID='2' /&gt;&lt;P N='AppRelativeTemplateSourceDirectory' R='-1' /&gt;"/> <SharePoint:CssRegistration name="<% $SPUrl:~SiteCollection/Style Library/zz1_blue.css%>" runat="server" __designer:Preview="&lt;link rel=&quot;stylesheet&quot; type=&quot;text/css&quot; href=&quot;/Style%20Library/zz1_blue.css&quot;/&gt; " __designer:Values="&lt;P N='Name' Bound='True' T='SPUrl:~SiteCollection/Style Library/zz1_blue.css' /&gt;&lt;P N='InDesign' T='False' /&gt;&lt;P N='ID' T='ctl04' /&gt;&lt;P N='Page' ID='1' /&gt;&lt;P N='TemplateControl' ID='2' /&gt;&lt;P N='AppRelativeTemplateSourceDirectory' R='-1' /&gt;"/> <SharePoint:ScriptLink name="init.js" runat="server" __designer:Preview="&lt;script src=&quot;/_layouts/1033/init.js?rev=VhAxGc3rkK79RM90tibDzw%3D%3D&quot;&gt;&lt;/script&gt; " __designer:Values="&lt;P N='Name' T='init.js' /&gt;&lt;P N='InDesign' T='False' /&gt;&lt;P N='ID' T='ctl05' /&gt;&lt;P N='Page' ID='1' /&gt;&lt;P N='TemplateControl' ID='2' /&gt;&lt;P N='AppRelativeTemplateSourceDirectory' R='-1' /&gt;"/> <SharePoint:ScriptLink Name="highslide-with-html.js" runat="server" __designer:Error="Access to the path 'C:\Program Files\Common Files\Microsoft Shared\Web Server Extensions\12\Template\layouts\1033\highslide-with-html.js' is denied."/> <!--Placeholder for additional overrides--> <asp:ContentPlaceHolder id="PlaceHolderAdditionalPageHead" runat="server"/> </head> <body class="body" onload="javascript:_spBodyOnLoadWrapper();"> <WebPartPages:SPWebPartManager runat="server"/> <form runat="server" onsubmit="return _spFormOnSubmitWrapper();"> <table cellpadding="0" cellspacing="0" class="master"> <tr> <td height="100%" class="shadowLeft"> <div class="spacer"> </div> </td> <td valign="top"> <table cellpadding="0" cellspacing="0" width="100%" class="masterContent"> <tr style="height:0px"><td> <wssuc:DesignModeConsole id="IdDesignModeConsole" runat="server" __designer:Preview="&lt;span __designer:NonVisual=&quot;true&quot;&gt;[ DesignModeConsoleContainer &quot;DesignModeContainer&quot; ]&lt;/span&gt; " __designer:Values="&lt;P N='ID' ID='1' T='IdDesignModeConsole' /&gt;&lt;P N='TemplateControl' R='0' /&gt;"/></td></tr> <tr> <td colspan="2" class="authoringRegion"> <span class="siteActionMenu"> <PublishingSiteAction:SiteActionMenu runat="server" __designer:Preview=" &lt;!-- Begin Action Menu Markup --&gt; &lt;table height=100% class=&quot;ms-siteaction&quot; cellpadding=0 cellspacing=0&gt; &lt;tr&gt; &lt;td class=&quot;ms-siteactionsmenu&quot; id=&quot;siteactiontd&quot;&gt; &lt;span style=&quot;display:none&quot;&gt;&lt;menu type='ServerMenu' id=&quot;zz1_SiteActionsMenuMain&quot; largeIconMode=&quot;true&quot;&gt;&lt;ie:menuitem id=&quot;zz2_MenuItem_Create&quot; type=&quot;option&quot; iconSrc=&quot;/_layouts/images/Actionscreate.gif&quot; onMenuClick=&quot;window.location = '/_layouts/create.aspx';&quot; menuGroupId=&quot;100&quot;&gt;&lt;/ie:menuitem&gt;&lt;ie:menuitem id=&quot;zz3_MenuItem_Settings&quot; type=&quot;option&quot; iconSrc=&quot;/_layouts/images/ActionsSettings.gif&quot; onMenuClick=&quot;window.location = '/_layouts/settings.aspx';&quot; menuGroupId=&quot;100&quot;&gt;&lt;/ie:menuitem&gt;&lt;/menu&gt;&lt;/span&gt;&lt;div&gt;&lt;div&gt;&lt;span title=&quot;Open Menu&quot;&gt;&lt;div id=&quot;zz4_SiteActionsMenu_t&quot; class=&quot;&quot; onmouseover=&quot;MMU_PopMenuIfShowing(this);MMU_EcbTableMouseOverOut(this, true)&quot; hoverActive=&quot;ms-siteactionsmenuhover&quot; hoverInactive=&quot;&quot; onclick=&quot; MMU_Open(byid(''), MMU_GetMenuFromClientId('zz4_SiteActionsMenu'),event,false, null, 0);&quot; foa=&quot;MMU_GetMenuFromClientId('zz4_SiteActionsMenu')&quot; oncontextmenu=&quot;this.click(); return false;&quot; nowrap=&quot;nowrap&quot;&gt;&lt;a id=&quot;zz4_SiteActionsMenu&quot; accesskey=&quot;/&quot; href=&quot;#&quot; onclick=&quot;javascript:return false;&quot; style=&quot;cursor:pointer;white-space:nowrap;&quot; onfocus=&quot;MMU_EcbLinkOnFocusBlur(byid(''), this, true);&quot; onkeydown=&quot;MMU_EcbLinkOnKeyDown(byid(''), MMU_GetMenuFromClientId('zz4_SiteActionsMenu'), event);&quot; onclick=&quot; MMU_Open(byid(''), MMU_GetMenuFromClientId('zz4_SiteActionsMenu'),event,false, null, 0);&quot; oncontextmenu=&quot;this.click(); return false;&quot; menuTokenValues=&quot;MENUCLIENTID=zz4_SiteActionsMenu,TEMPLATECLIENTID=zz1_SiteActionsMenuMain&quot; serverclientid=&quot;zz4_SiteActionsMenu&quot;&gt;Site Actions&lt;img src=&quot;/_layouts/images/blank.gif&quot; border=&quot;0&quot; alt=&quot;Use SHIFT+ENTER to open the menu (new window).&quot;/&gt;&lt;/a&gt;&lt;img align=&quot;absbottom&quot; src=&quot;/_layouts/images/whitearrow.gif&quot; alt=&quot;&quot; /&gt;&lt;/div&gt;&lt;/span&gt;&lt;/div&gt;&lt;/div&gt; &lt;/td&gt; &lt;/tr&gt; &lt;/table&gt; &lt;!-- End Action Menu Markup --&gt; " __designer:Values="&lt;P N='TemplateControl' R='0' /&gt;"/> </span> <div class="sharepointLogin"> <!--Authentication for Authors only--> <table cellpadding="0" cellspacing="0" > <tr> <td class="ms-globallinks"> <SharePoint:DelegateControl ControlId="GlobalSiteLink1" Scope="Farm" runat="server" __designer:Preview="&lt;span style='padding-left:3px'&gt;&lt;/span&gt; &lt;a id=&quot;ctl00_ctl09_hlMySite&quot; href=&quot;http://litwaredemo:80/MySite/_layouts/MySite.aspx&quot;&gt;My Site&lt;/a&gt; &lt;span style='padding-left:4px;padding-right:3px'&gt;|&lt;/span&gt; " __designer:Values="&lt;P N='ControlId' T='GlobalSiteLink1' /&gt;&lt;P N='Scope' T='Farm' /&gt;&lt;P N='ID' T='ctl08' /&gt;&lt;P N='Page' ID='1' /&gt;&lt;P N='TemplateControl' ID='2' /&gt;&lt;P N='AppRelativeTemplateSourceDirectory' R='-1' /&gt;"/></td> <td class="ms-globallinks"> <SharePoint:DelegateControl ControlId="GlobalSiteLink2" Scope="Farm" runat="server" __designer:Preview="&lt;span id=&quot;ctl00_ctl11_MyLinksMenu&quot;&gt;&lt;span style=&quot;display:none&quot;&gt;&lt;menu type='ServerMenu' id=&quot;ctl00_ctl11_MyLinksMenuMenuTemplate&quot; largeIconMode=&quot;true&quot;&gt;&lt;/menu&gt;&lt;/span&gt;&lt;span title=&quot;Open Menu&quot;&gt;&lt;span id=&quot;ctl00_ctl11_MyLinksMenuMenu_t&quot; class=&quot;ms-SPLink ms-hovercellinactive&quot; onmouseover=&quot;MMU_PopMenuIfShowing(this);MMU_EcbTableMouseOverOut(this, true)&quot; hoverActive=&quot;ms-SPLink ms-hovercellactive&quot; hoverInactive=&quot;ms-SPLink ms-hovercellinactive&quot; onclick=&quot;javascript:FetchCallbackMenuItems(&amp;#39;ctl00_ctl11_MyLinksMenuMenuTemplate&amp;#39;); MMU_Open(byid('ctl00_ctl11_MyLinksMenuMenuTemplate'), MMU_GetMenuFromClientId('ctl00_ctl11_MyLinksMenuMenu'),event,true, null, 0);&quot; foa=&quot;MMU_GetMenuFromClientId('ctl00_ctl11_MyLinksMenuMenu')&quot; oncontextmenu=&quot;this.click(); return false;&quot; nowrap=&quot;nowrap&quot;&gt;&lt;a id=&quot;ctl00_ctl11_MyLinksMenuMenu&quot; accesskey=&quot;M&quot; href=&quot;#&quot; onclick=&quot;javascript:return false;&quot; style=&quot;cursor:pointer;white-space:nowrap;&quot; onfocus=&quot;MMU_EcbLinkOnFocusBlur(byid('ctl00_ctl11_MyLinksMenuMenuTemplate'), this, true);&quot; onkeydown=&quot;MMU_EcbLinkOnKeyDown(byid('ctl00_ctl11_MyLinksMenuMenuTemplate'), MMU_GetMenuFromClientId('ctl00_ctl11_MyLinksMenuMenu'), event);&quot; onclick=&quot;javascript:FetchCallbackMenuItems(&amp;#39;ctl00_ctl11_MyLinksMenuMenuTemplate&amp;#39;); MMU_Open(byid('ctl00_ctl11_MyLinksMenuMenuTemplate'), MMU_GetMenuFromClientId('ctl00_ctl11_MyLinksMenuMenu'),event,true, null, 0);&quot; oncontextmenu=&quot;this.click(); return false;&quot; menuTokenValues=&quot;MENUCLIENTID=ctl00_ctl11_MyLinksMenuMenu,TEMPLATECLIENTID=ctl00_ctl11_MyLinksMenuMenuTemplate&quot; serverclientid=&quot;ctl00_ctl11_MyLinksMenuMenu&quot;&gt;My Links&lt;img src=&quot;/_layouts/images/blank.gif&quot; border=&quot;0&quot; alt=&quot;Use SHIFT+ENTER to open the menu (new window).&quot;/&gt;&lt;/a&gt;&lt;img align=&quot;absbottom&quot; src=&quot;/_layouts/images/menudark.gif&quot; alt=&quot;&quot; /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;|" __designer:Values="&lt;P N='ControlId' T='GlobalSiteLink2' /&gt;&lt;P N='Scope' T='Farm' /&gt;&lt;P N='ID' T='ctl10' /&gt;&lt;P N='Page' ID='1' /&gt;&lt;P N='TemplateControl' ID='2' /&gt;&lt;P N='AppRelativeTemplateSourceDirectory' R='-1' /&gt;"/></td> <td class="ms-globallinks"> <wssuc:Welcome id="explitLogout" runat="server" __designer:Preview=" &lt;span style=&quot;display:none&quot;&gt;&lt;menu type='ServerMenu' id=&quot;zz5_ID_PersonalActionMenu&quot; largeIconMode=&quot;true&quot;&gt;&lt;ie:menuitem id=&quot;zz6_ID_PersonalInformation&quot; type=&quot;option&quot; iconSrc=&quot;/_layouts/images/menuprofile.gif&quot; onMenuClick=&quot;javascript:GoToPage('\u002f_layouts\u002fuserdisp.aspx?Force=True\u0026ID=' + _spUserId);return false;&quot; menuGroupId=&quot;100&quot;&gt;&lt;/ie:menuitem&gt;&lt;ie:menuitem id=&quot;zz7_ID_LoginAsDifferentUser&quot; type=&quot;option&quot; onMenuClick=&quot;javascript:LoginAsAnother('\u002f_layouts\u002fAccessDenied.aspx?loginasanotheruser=true', 0)&quot; menuGroupId=&quot;200&quot;&gt;&lt;/ie:menuitem&gt;&lt;ie:menuitem id=&quot;zz8_ID_RequestAccess&quot; type=&quot;option&quot; onMenuClick=&quot;window.location = '/_layouts/reqacc.aspx?type=list&amp;amp;name=%7B36F0105B%2D0F8E%2D4A22%2DBE90%2D716A51E97B5D%7D';&quot; menuGroupId=&quot;200&quot;&gt;&lt;/ie:menuitem&gt;&lt;ie:menuitem id=&quot;zz9_ID_Logout&quot; type=&quot;option&quot; onMenuClick=&quot;window.location = '/_layouts/SignOut.aspx';&quot; menuGroupId=&quot;200&quot;&gt;&lt;/ie:menuitem&gt;&lt;/menu&gt;&lt;/span&gt;&lt;span title=&quot;Open Menu&quot;&gt;&lt;div id=&quot;zz10_Menu_t&quot; class=&quot;ms-SPLink ms-SpLinkButtonInActive&quot; onmouseover=&quot;MMU_PopMenuIfShowing(this);MMU_EcbTableMouseOverOut(this, true)&quot; hoverActive=&quot;ms-SPLink ms-SpLinkButtonActive&quot; hoverInactive=&quot;ms-SPLink ms-SpLinkButtonInActive&quot; onclick=&quot; MMU_Open(byid(''), MMU_GetMenuFromClientId('zz10_Menu'),event,false, null, 0);&quot; foa=&quot;MMU_GetMenuFromClientId('zz10_Menu')&quot; oncontextmenu=&quot;this.click(); return false;&quot; nowrap=&quot;nowrap&quot;&gt;&lt;a id=&quot;zz10_Menu&quot; accesskey=&quot;L&quot; href=&quot;#&quot; onclick=&quot;javascript:return false;&quot; style=&quot;cursor:pointer;white-space:nowrap;&quot; onfocus=&quot;MMU_EcbLinkOnFocusBlur(byid(''), this, true);&quot; onkeydown=&quot;MMU_EcbLinkOnKeyDown(byid(''), MMU_GetMenuFromClientId('zz10_Menu'), event);&quot; onclick=&quot; MMU_Open(byid(''), MMU_GetMenuFromClientId('zz10_Menu'),event,false, null, 0);&quot; oncontextmenu=&quot;this.click(); return false;&quot; menuTokenValues=&quot;MENUCLIENTID=zz10_Menu,TEMPLATECLIENTID=zz5_ID_PersonalActionMenu&quot; serverclientid=&quot;zz10_Menu&quot;&gt;Welcome LitwareInc Administrator&lt;img src=&quot;/_layouts/images/blank.gif&quot; border=&quot;0&quot; alt=&quot;Use SHIFT+ENTER to open the menu (new window).&quot;/&gt;&lt;/a&gt;&lt;img align=&quot;absbottom&quot; src=&quot;/_layouts/images/menudark.gif&quot; alt=&quot;&quot; /&gt;&lt;/div&gt;&lt;/span&gt;&lt;script type=&quot;text/javascript&quot; language=&quot;javascript&quot;&gt;var _spUserId=1;&lt;/script&gt; &lt;a id=&quot;explitLogout_ExplicitLogin&quot; Href=&quot;_controltemplates/http://litwaredemo/_layouts/Authenticate.aspx&quot; style=&quot;display:none&quot;&gt;Sign In&lt;/a&gt; " __designer:Values="&lt;P N='ID' ID='1' T='explitLogout' /&gt;&lt;P N='TemplateControl' R='0' /&gt;"/></td> </tr> </table> </div> <div class="console"> <PublishingConsole:Console runat="server" __designer:Preview=" &lt;!-- Console --&gt; &lt;span id=&quot;ctl00_publishingContext1&quot;&gt;&lt;/span&gt; &lt;script type=&quot;text/javascript&quot; language=&quot;javascript&quot;&gt;if (document.getElementById('mpdmconsole')) { ShowConsoleBlockPaddingWithOverhang('mpLeftBackPadding', 'mpRightBackPadding', 'masterPageLeftOverhang', 'masterPageRightOverhang'); } &lt;/script&gt; &lt;!-- Console --&gt; " __designer:Values="&lt;P N='TemplateControl' R='0' /&gt;"/> </div> </td> </tr> <tr> <td colspan="2" > <table cellpadding="0" cellspacing="0" width="100%"> <tr> <td colspan="4" class="topArea"> <SharePoint:AspMenu ID="logoLinkId" runat="server" DataSourceID="SiteMapDataSourceRoot" StaticDisplayLevels="1" MaximumDynamicDisplayLevels="0" AccessKey="1" CssClass="logo" __designer:Preview="&lt;table id=&quot;zz12_logoLinkId&quot; class=&quot;logo&quot; cellpadding=&quot;0&quot; cellspacing=&quot;0&quot; border=&quot;0&quot;&gt; &lt;tr id=&quot;zz12_logoLinkIdn0&quot;&gt; &lt;td&gt;&lt;table cellpadding=&quot;0&quot; cellspacing=&quot;0&quot; border=&quot;0&quot; width=&quot;100%&quot;&gt; &lt;tr&gt; &lt;td style=&quot;white-space:nowrap;width:100%;&quot;&gt;&lt;a Href=&quot;/Pages/Default.aspx&quot; accesskey=&quot;1&quot; style=&quot;text-decoration:none;&quot;&gt;Home&lt;/a&gt;&lt;/td&gt; &lt;/tr&gt; &lt;/table&gt;&lt;/td&gt; &lt;/tr&gt; &lt;/table&gt;" __designer:Values="&lt;P N='ID' T='logoLinkId' /&gt;&lt;P N='MaximumDynamicDisplayLevels' T='0' /&gt;&lt;P N='DataSourceID' T='SiteMapDataSourceRoot' /&gt;&lt;P N='AccessKey' T='1' /&gt;&lt;P N='ControlStyle'&gt;&lt;P N='CssClass' ID='1' T='logo' /&gt;&lt;P N='Font' ID='2' /&gt;&lt;P N='IsEmpty' T='False' /&gt;&lt;/P&gt;&lt;P N='CssClass' R='1' /&gt;&lt;P N='Font' R='2' /&gt;&lt;P N='Page' ID='3' /&gt;&lt;P N='TemplateControl' ID='4' /&gt;&lt;P N='AppRelativeTemplateSourceDirectory' R='-1' /&gt;" __designer:Templates="&lt;Group Name=&quot;Item Templates&quot;&gt;&lt;Template Name=&quot;StaticItemTemplate&quot; Flags=&quot;D&quot; Content=&quot;&quot; /&gt;&lt;Template Name=&quot;DynamicItemTemplate&quot; Flags=&quot;D&quot; Content=&quot;&quot; /&gt;&lt;/Group&gt;"/> <PublishingNavigation:PortalSiteMapDataSource ID="SiteMapDataSourceRoot" Runat="server" SiteMapProvider="CombinedNavSiteMapProvider" EnableViewState="true" StartFromCurrentNode="true" StartingNodeOffset="0" ShowStartingNode="true" __designer:Preview="&lt;table cellpadding=4 cellspacing=0 style=&quot;font:messagebox;color:buttontext;background-color:buttonface;border: solid 1px;border-top-color:buttonhighlight;border-left-color:buttonhighlight;border-bottom-color:buttonshadow;border-right-color:buttonshadow&quot;&gt; &lt;tr&gt;&lt;td nowrap&gt;&lt;span style=&quot;font-weight:bold&quot;&gt;PortalSiteMapDataSource&lt;/span&gt; - SiteMapDataSourceRoot&lt;/td&gt;&lt;/tr&gt; &lt;tr&gt;&lt;td&gt;&lt;/td&gt;&lt;/tr&gt; &lt;/table&gt;" __designer:Values="&lt;P N='ID' T='SiteMapDataSourceRoot' /&gt;&lt;P N='SiteMapProvider' T='CombinedNavSiteMapProvider' /&gt;&lt;P N='StartFromCurrentNode' T='True' /&gt;&lt;P N='Page' ID='1' /&gt;&lt;P N='TemplateControl' ID='2' /&gt;&lt;P N='AppRelativeTemplateSourceDirectory' R='-1' /&gt;"/> <div class="topLinkBar"> <div class="topLink"> <PublishingVariations:VariationsLabelMenu id="labelmenu1" runat="server" __designer:Preview="&lt;span __designer:NonVisual=&quot;true&quot;&gt;&lt;table cellpadding=4 cellspacing=0 style=&quot;font:messagebox;color:buttontext;background-color:buttonface;border: solid 1px;border-top-color:buttonhighlight;border-left-color:buttonhighlight;border-bottom-color:buttonshadow;border-right-color:buttonshadow&quot;&gt; &lt;tr&gt;&lt;td nowrap&gt;&lt;span style=&quot;font-weight:bold&quot;&gt;VariationDataSource&lt;/span&gt; - LabelMenuDataSource&lt;/td&gt;&lt;/tr&gt; &lt;tr&gt;&lt;td&gt;&lt;/td&gt;&lt;/tr&gt; &lt;/table&gt;&lt;/span&gt; " __designer:Values="&lt;P N='ID' ID='1' T='labelmenu1' /&gt;&lt;P N='TemplateControl' R='0' /&gt;"/> </div> </div> </td> </tr> <tr class="topNavContainer"> <td class="topNavRoundLeft"> <div class="glassSpacerLeft" /> </td> <td valign="top" width="100%"> <SharePoint:AspMenu ID="GlobalNav" Runat="server" DataSourceID="SiteMapDataSource1" Orientation="Horizontal" StaticDisplayLevels="1" MaximumDynamicDisplayLevels="1" StaticSubMenuIndent="0" DynamicHorizontalOffset="0" DynamicVerticalOffset="-8" StaticEnableDefaultPopOutImage="false" ItemWrap="false" SkipLinkText="<%$Resources:cms,masterpages_skiplinktext%>" CssClass="topNav" __designer:Preview="&lt;table id=&quot;zz13_GlobalNav&quot; class=&quot;topNav&quot; cellpadding=&quot;0&quot; cellspacing=&quot;0&quot; border=&quot;0&quot;&gt; &lt;tr&gt; &lt;td title=&quot;Document Center site&quot; id=&quot;zz13_GlobalNavn0&quot;&gt;&lt;table class=&quot;topNavItem&quot; cellpadding=&quot;0&quot; cellspacing=&quot;0&quot; border=&quot;0&quot; width=&quot;100%&quot;&gt; &lt;tr&gt; &lt;td style=&quot;white-space:nowrap;&quot;&gt;&lt;a class=&quot;topNavItem&quot; Href=&quot;/Docs&quot; style=&quot;text-decoration:none;border-style:none;&quot;&gt;Document Center&lt;/a&gt;&lt;/td&gt; &lt;/tr&gt; &lt;/table&gt;&lt;/td&gt;&lt;td style=&quot;width:0px;&quot;&gt;&lt;/td&gt;&lt;td style=&quot;width:0px;&quot;&gt;&lt;/td&gt;&lt;td title=&quot;Company News Home&quot; id=&quot;zz13_GlobalNavn1&quot;&gt;&lt;table class=&quot;topNavItem&quot; cellpadding=&quot;0&quot; cellspacing=&quot;0&quot; border=&quot;0&quot; width=&quot;100%&quot;&gt; &lt;tr&gt; &lt;td style=&quot;white-space:nowrap;&quot;&gt;&lt;a class=&quot;topNavItem&quot; Href=&quot;/News/Pages/Default.aspx&quot; style=&quot;text-decoration:none;border-style:none;&quot;&gt;News&lt;/a&gt;&lt;/td&gt; &lt;/tr&gt; &lt;/table&gt;&lt;/td&gt;&lt;td style=&quot;width:0px;&quot;&gt;&lt;/td&gt;&lt;td style=&quot;width:0px;&quot;&gt;&lt;/td&gt;&lt;td title=&quot;Report Center&quot; id=&quot;zz13_GlobalNavn2&quot;&gt;&lt;table class=&quot;topNavItem&quot; cellpadding=&quot;0&quot; cellspacing=&quot;0&quot; border=&quot;0&quot; width=&quot;100%&quot;&gt; &lt;tr&gt; &lt;td style=&quot;white-space:nowrap;&quot;&gt;&lt;a class=&quot;topNavItem&quot; Href=&quot;/Reports/Pages/Default.aspx&quot; style=&quot;text-decoration:none;border-style:none;&quot;&gt;Reports&lt;/a&gt;&lt;/td&gt; &lt;/tr&gt; &lt;/table&gt;&lt;/td&gt;&lt;td style=&quot;width:0px;&quot;&gt;&lt;/td&gt;&lt;td style=&quot;width:0px;&quot;&gt;&lt;/td&gt;&lt;td title=&quot;The Search Center displays search results&quot; id=&quot;zz13_GlobalNavn3&quot;&gt;&lt;table class=&quot;topNavItem&quot; cellpadding=&quot;0&quot; cellspacing=&quot;0&quot; border=&quot;0&quot; width=&quot;100%&quot;&gt; &lt;tr&gt; &lt;td style=&quot;white-space:nowrap;&quot;&gt;&lt;a class=&quot;topNavItem&quot; Href=&quot;/SearchCenter/Pages/default.aspx&quot; style=&quot;text-decoration:none;border-style:none;&quot;&gt;Search&lt;/a&gt;&lt;/td&gt; &lt;/tr&gt; &lt;/table&gt;&lt;/td&gt;&lt;td style=&quot;width:0px;&quot;&gt;&lt;/td&gt;&lt;td style=&quot;width:0px;&quot;&gt;&lt;/td&gt;&lt;td title=&quot;Site Directory web&quot; id=&quot;zz13_GlobalNavn4&quot;&gt;&lt;table class=&quot;topNavItem&quot; cellpadding=&quot;0&quot; cellspacing=&quot;0&quot; border=&quot;0&quot; width=&quot;100%&quot;&gt; &lt;tr&gt; &lt;td style=&quot;white-space:nowrap;&quot;&gt;&lt;a class=&quot;topNavItem&quot; Href=&quot;/SiteDirectory/Pages/category.aspx&quot; style=&quot;text-decoration:none;border-style:none;&quot;&gt;Sites&lt;/a&gt;&lt;/td&gt; &lt;/tr&gt; &lt;/table&gt;&lt;/td&gt;&lt;td style=&quot;width:0px;&quot;&gt;&lt;/td&gt; &lt;/tr&gt; &lt;/table&gt;" __designer:Values="&lt;P N='ID' T='GlobalNav' /&gt;&lt;P N='DynamicHoverStyle'&gt;&lt;P N='CssClass' T='topNavFlyOutsHover' /&gt;&lt;P N='IsEmpty' T='False' /&gt;&lt;/P&gt;&lt;P N='DynamicMenuItemStyle'&gt;&lt;P N='CssClass' T='topNavFlyOutsItem' /&gt;&lt;P N='IsEmpty' T='False' /&gt;&lt;/P&gt;&lt;P N='DynamicMenuStyle'&gt;&lt;P N='CssClass' T='topNavFlyOuts' /&gt;&lt;P N='IsEmpty' T='False' /&gt;&lt;/P&gt;&lt;P N='DynamicVerticalOffset' T='-8' /&gt;&lt;P N='MaximumDynamicDisplayLevels' T='1' /&gt;&lt;P N='Orientation' E='0' /&gt;&lt;P N='SkipLinkText' Bound='True' T='Resources:cms,masterpages_skiplinktext' /&gt;&lt;P N='StaticEnableDefaultPopOutImage' T='False' /&gt;&lt;P N='StaticHoverStyle'&gt;&lt;P N='CssClass' T='topNavHover' /&gt;&lt;P N='IsEmpty' T='False' /&gt;&lt;/P&gt;&lt;P N='StaticMenuItemStyle'&gt;&lt;P N='CssClass' T='topNavItem' /&gt;&lt;P N='ItemSpacing' T='0px' /&gt;&lt;P N='IsEmpty' T='False' /&gt;&lt;/P&gt;&lt;P N='StaticSelectedStyle'&gt;&lt;P N='CssClass' T='topNavSelected' /&gt;&lt;P N='ItemSpacing' T='0px' /&gt;&lt;P N='IsEmpty' T='False' /&gt;&lt;/P&gt;&lt;P N='StaticSubMenuIndent' T='0px' /&gt;&lt;P N='DataSourceID' T='SiteMapDataSource1' /&gt;&lt;P N='ControlStyle'&gt;&lt;P N='CssClass' ID='1' T='topNav' /&gt;&lt;P N='Font' ID='2' /&gt;&lt;P N='IsEmpty' T='False' /&gt;&lt;/P&gt;&lt;P N='CssClass' R='1' /&gt;&lt;P N='Font' R='2' /&gt;&lt;P N='Page' ID='3' /&gt;&lt;P N='TemplateControl' ID='4' /&gt;&lt;P N='AppRelativeTemplateSourceDirectory' R='-1' /&gt;" __designer:Templates="&lt;Group Name=&quot;Item Templates&quot;&gt;&lt;Template Name=&quot;StaticItemTemplate&quot; Flags=&quot;D&quot; Content=&quot;&quot; /&gt;&lt;Template Name=&quot;DynamicItemTemplate&quot; Flags=&quot;D&quot; Content=&quot;&quot; /&gt;&lt;/Group&gt;"> <StaticMenuItemStyle CssClass="topNavItem" ItemSpacing="0"/> <StaticSelectedStyle CssClass="topNavSelected" ItemSpacing="0"/> <StaticHoverStyle CssClass="topNavHover"/> <DynamicMenuStyle CssClass="topNavFlyOuts" /> <DynamicMenuItemStyle CssClass="topNavFlyOutsItem" /> <DynamicHoverStyle CssClass="topNavFlyOutsHover"/> </SharePoint:AspMenu> <PublishingNavigation:PortalSiteMapDataSource ID="siteMapDataSource1" Runat="server" SiteMapProvider="CombinedNavSiteMapProvider" EnableViewState="true" StartFromCurrentNode="true" StartingNodeOffset="0" ShowStartingNode="false" TreatStartingNodeAsCurrent="true" TrimNonCurrentTypes="Heading" __designer:Preview="&lt;table cellpadding=4 cellspacing=0 style=&quot;font:messagebox;color:buttontext;background-color:buttonface;border: solid 1px;border-top-color:buttonhighlight;border-left-color:buttonhighlight;border-bottom-color:buttonshadow;border-right-color:buttonshadow&quot;&gt; &lt;tr&gt;&lt;td nowrap&gt;&lt;span style=&quot;font-weight:bold&quot;&gt;PortalSiteMapDataSource&lt;/span&gt; - siteMapDataSource1&lt;/td&gt;&lt;/tr&gt; &lt;tr&gt;&lt;td&gt;&lt;/td&gt;&lt;/tr&gt; &lt;/table&gt;" __designer:Values="&lt;P N='ID' T='siteMapDataSource1' /&gt;&lt;P N='SiteMapProvider' T='CombinedNavSiteMapProvider' /&gt;&lt;P N='StartFromCurrentNode' T='True' /&gt;&lt;P N='ShowStartingNode' T='False' /&gt;&lt;P N='TreatStartingNodeAsCurrent' T='True' /&gt;&lt;P N='TrimNonCurrentTypes' E='32' /&gt;&lt;P N='Page' ID='1' /&gt;&lt;P N='TemplateControl' ID='2' /&gt;&lt;P N='AppRelativeTemplateSourceDirectory' R='-1' /&gt;"/> </td> <td> <div class="search"> <asp:ContentPlaceHolder id="PlaceHolderSearchArea" runat="server"> <SPSWC:SearchBoxEx id="SearchBox" RegisterStyles="false" TextBeforeDropDown="" TextBeforeTextBox="<%$Resources:cms,masterpages_searchbox_label%>" TextBoxWidth="100" GoImageUrl="<% $SPUrl:~sitecollection/Style Library/Images/Search_Arrow.jpg %>" GoImageUrlRTL="<% $SPUrl:~sitecollection/Style Library/Images/Search_Arrow_RTL.jpg %>" UseSiteDefaults="true" DropDownMode = "HideScopeDD" SuppressWebPartChrome="true" runat="server" WebPart="true" __WebPartId="{7DECDCCA-FDA0-4739-8F0E-7B8DE48F0E0D}" __Preview="&lt;table TOPLEVEL border=&quot;0&quot; cellpadding=&quot;0&quot; cellspacing=&quot;0&quot; width=&quot;100%&quot;&gt; &lt;tr&gt; &lt;td&gt;&lt;table border=&quot;0&quot; cellpadding=&quot;0&quot; cellspacing=&quot;0&quot; width=&quot;100%&quot;&gt; &lt;tr class=&quot;ms-WPHeader&quot;&gt; &lt;td title=&quot;&quot; id=&quot;WebPart

    Read the article

  • Selecting text in mobile Safari on iPhone

    - by Goldy
    I'm trying to make it easy for an iphone user to copy some text to the clipboard in mobile safari. As in the usual "touch-hold-copy". There is a specific bit of text I want to a user to copy. I have full choice of the html markup in which to wrap the text. How can I make it easy, rather than abitrary? For instance: Is there a way to "select all" the text upon touch-down using javascript? Then a user could just continue to touch-hold and then choose copy? Is there a way to bring up the "select all" option? Like you can when typing in a text box? After which they can choose copy? If there's no javascript solution, how can I arrange the html to help Safari select the right bit of text easily? As opposed to just a word, or a wrapping div? I've tried onFocus="this.select()" for various elements, none seem to work. Also tried onClick. Those who have tried to port a site that uses ZeroClipboard to the iPhone might have some ideas. Cheers

    Read the article

  • Android: Map Overlay Labels

    - by karnage
    I am building a MapView and I want my custom overlay items to display the name of the location they are marking when the user taps them, like the Android Maps app. I setup the onTap listener and the floating TextView to hold the location name. I still need to set it up so that it redraws the label when the user moves the map, etc. Anyway, I am wondering if I am reinventing the wheel here. Is there a built-in method I am unaware of? I would think that most implementations of MapView have labels. For reference, my implementation so far: in map xml: <LinearLayout android:id="@+id/mapBubbleWrap" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_alignParentTop="true"> <TextView android:id="@+id/mapBubble" android:layout_width="wrap_content" android:layout_height="wrap_content" android:visibility="gone" android:background="#ffffff" android:textColor="#ff0000"/> </LinearLayout> in my extended ItemizedOverlay: public boolean onTap(int index) { this.setFocus( mOverlays.get(index) ); return true; } in my Activity onFocus: public void onFocusChanged( ItemizedOverlay overlay, OverlayItem item ) { if( item != null) { mapBubble.setText(item.getTitle()); Point newPoint = mapView.getProjection().toPixels(item.getPoint(), null); mapBubbleWrap.setPadding(newPoint.x, newPoint.y-10, 0, 0); mapBubble.setVisibility(View.VISIBLE); } }

    Read the article

  • converted javascript to fbjs - tabs still not working

    - by JohnMerlino
    Hey all, I tried my best to convert javascript to fbjs according to this page: http://wiki.developers.facebook.com/index.php/FBJS. Yet my tabs are still not working properly. Does anyone have any suggestions how to fix this so I can click through the tabs and display and hide content accordingly: <script type="text/javascript"><!-- var tabLinks = []; var contentDivs = []; function init() { var tabListItems = document.getElementById('tabs').getChildNodes(); for ( var i = 0; i < tabListItems.length; i++ ) { if ( tabListItems[i].getNodeName("LI") ) { var tabLink = getFirstChildWithTagName( tabListItems[i], 'A' ); var id = getHash( tabLink.getAttribute('href') ); tabLinks[id] = tabLink; contentDivs[id] = document.getElementById( id ); } } var i = 0; for ( var id in tabLinks ) { tabLinks[id].addEventListener(onclick, showTab) tabLinks[id].addEventListener(onfocus, function() { this.blur() }; if ( i == 0 ) tabLinks[id].setClassName('selected'); i++;) } var i = 0; for ( var id in contentDivs ) { if ( i != 0 ) contentDivs[id].setClassName('tabContent hide'); i++; } } function showTab() { var selectedId = getHash( this.getAttribute('href') ); for ( var id in contentDivs ) { if ( id == selectedId ) { tabLinks[id].setClassName('selected'); contentDivs[id].setClassName('tabContent'); } else { tabLinks[id].setClassName(''); contentDivs[id].setClassName('tabContent hide'); } } return false; } function getFirstChildWithTagName( element, tagName ) { for ( var i = 0; i < element.getChildNodes().length; i++ ) { if ( element.getChildNodes[i].getNodeName(tagName) ) return element.getChildNodes[i]; } } function getHash( url ) { var hashPos = url.getLastIndexOf ( '#' ); return url.getSubString( hashPos + 1 ); } init(); --></script> Thanks for any response.

    Read the article

  • How can I access master page text box from jquery file?

    - by stackuser1
    In my master page i've a textbox. <asp:TextBox ID="SearchTextBox" runat="server" class="searchtxtbox" onfocus="HideSearchWaterMark();" Text="Search" onblur="ShowSearchWaterMark(this);" /> I added jquery references in code behind. TextBox SearchTextBox = this.FindControl("SearchTextBox") as TextBox; StringBuilder objStringBuilder = new StringBuilder(); objStringBuilder.Append("<script type=\"text/javascript\" language=\"javascript\">\n"); objStringBuilder.AppendFormat("var searchTextBox = '{0}';\n", SearchTextBox.ClientID); objStringBuilder.Append("</script>\n"); this.Page.ClientScript.RegisterClientScriptBlock(GetType(), "RegisterVariables", objStringBuilder.ToString()); this.Page.ClientScript.RegisterClientScriptInclude(this.GetType(), "Global", this.ResolveClientUrl("~/Resources/Scripts/Search.js")); this.Page.ClientScript.RegisterClientScriptInclude(this.GetType(), "Global", this.ResolveClientUrl("~/Resources/Scripts/jquery-1.4.2.js")); this.Page.ClientScript.RegisterClientScriptInclude(this.GetType(), "Global", this.ResolveClientUrl("~/Resources/TagsScripts/jquery.autocomplete.js")); in Search.js i've the following methods to access the text box of master page: $(document).ready(function () { $("#" + searchTextBox).autocomplete("Handlers/GenericHandler.ashx?tgt=12", { multiple: true, multipleSeparator: ";", mustMatch: false, autoFill: true }); }); function HideSearchWaterMark() { var control = $("#" + searchTextBox); if (control[0].className == "searchtxtbox ac_input") control[0].value = ""; control[0].className = "searchtxtbox ac_input"; } function ShowSearchWaterMark(tagsTextBox) { if (searchTextBox.value.length == 0) { searchTextBox.value = "Search"; searchTextBox.className = "searchtxtbox ac_input"; } When i run my application i'm getting object reference not set error. Please tell me where i need to change my code.

    Read the article

  • How to automatically expand html select element in javascript

    - by xan
    I have a (hidden) html select object in my menu attached to a menu button link, so that clicking the link shows the list so you can pick from it. When you click the button, it calls some javascript to show the <select>. Clicking away from the <select> hides the list. What I really want is to make the <select> appear fully expanded, as if you had clicked on the "down" arrow, but I can't get this working. I've tried lots of different approaches, but can't make any headway. What I'm doing currently is this: <li> <a href="javascript:showlist();"><img src="/images/icons/add.png"/>Add favourite</a> <select id="list" style="display:none; onblur="javascript:cancellist()"> </select> </li> // in code function showlist() { //using prototype not jQuery $('list').show(); // shows the select list $('list').focus(); // sets focus so that when you click away it calles onblur() } I've tried calling $('list').click(). I've tried setting onfocus="this.click()" But in both cases I'm getting Uncaught TypeError: Object # has no method 'click' which is peculiar as link text says that it supports the standard functions. I've tried setting the .size = .length which works, but doesn't have the same appearance (as when you click to open the element, it floats over the rest of the page.) Does anyone have any suggestions?

    Read the article

  • radio button to php

    - by Azzyh
    Hello so i have this form: <form action="javascript:DoSCInsert()" method="post"> <textarea onfocus="this.cleared=true;javascript:clearContents(this);" rows="5" cols="40" id="comment" name="comment">...</textarea> Yes: <input type="radio" value="Y" id="SCvoteY" name="vote"></input> No: <input type="radio" id="SCvoteN" value="N" name="vote"> </input> <input type="hidden" name="fID" id="fID" value="<? echo $_GET["id"]; ?>" /> <input onsubmit="if (!this.comment.cleared) clearContent(this.comment); return true;" type="submit" name="Submit" value="Stem!"/> </form> Anyway so i have this javascript also that tranfers the output info to insertSC.php: function DoSCInsert(){ $("#SCres").html("to sek.."); var nocache = '0'; var data = { fID : $("#fID").val(), SCvote : $("#SCvoteY").val(), SCvote : $("#SCvoteN").val(), comment: $("#comment").val(), nocache: nocache }; $.get('insertSC.php', data, onSCInsertComplete); } function onSCInsertComplete(data,textstatus){ $("#SCres").html(data); } and in my insertSC.php i have this: <?php echo $_GET['comment']." - ".$_GET['SCvoteY']; ?> Now i get out comment but no SCvoteY.... this is just a test i made, what i was really making is that you vote Y or N and then it inserts into the vote column Y or N(what you pickd) now i couldnt figure how to do it/something went wrong somewhere and now i cant even get out SCvoteY i just get undefined index What i need help with is what i just mention i want to when you either choose Y or N it should output what you choose. If you didnt choose any (empty isset?) then false.. else echo Y or N(what you picked)

    Read the article

  • How to set different width for INPUT and DIV elements with Scriptaculous Ajax.Autocompleter?

    - by Grzegorz Gierlik
    Hello, I am working on autocompleter box based on Scriptaculous Ajax.Autocompleter. Here how my HTML/JS code looks like: <input type="text" maxlength="255" class="input iSearchInput" name="isearch_value" id="isearch" value="<wl@txt>Search</wl@txt>" onfocus="this.select()"> <br> <div id='isearch_choices' class='iSearchChoices'></div> <script> function iSearchGetSelectedId(text, li) { console.log([text, li.innerHTML].join("\n")); document.location.href = li.getAttribute("url"); } document.observe('dom:loaded', function() { new Ajax.Autocompleter("isearch", "isearch_choices", "/url", { paramName: "phrase", minChars: 1, afterUpdateElement : iSearchGetSelectedId }); $("isearch_choices").setStyle({width: "320px"}); }); </script> and CSS classes: input.iSearchInput { width: 155px; height: 26px; margin-top: 7px; line-height: 20px; } div.iSearchChoices { position:absolute; background-color:white; border:1px solid #888; margin:0; padding:0; width: 320px; } It works in general, but I need to have list of choices wider then input box. My first try was to set various width with CSS classes (like above), but it didn't work -- list of choices became as wide as input box. According to Firebug width defined by my CSS class was overwritten by width set by element.style CSS class, which seems to be defined by Ajax.Autocompleter. My second try was to set width for list of choices after creating Ajax.Autocompleter $("isearch_choices").setStyle({width: "320px"}); but it didn't work too :(. No more ideas :(. How to set different width for list of choices for Scriptaculous Ajax.Autocompleter?

    Read the article

  • JavaScript problems in one IIS server but not another

    - by DanyW
    Hi everyone, I have a problem that only occurs in one environment. On this particular page, somewhere in the top half of the element, an array is created and populated. This is later used in the onfocus event handlers of various controls. I use Firebug to debug the page and discovered the problem. In our dev environment the array is indeed created and populated. In our staging environment this block of script is not executed! I put a break point where the array is instantiated and it's never hit in staging, but is hit in dev. I'm really puzzled what aspects of the two environments can possibly affect this? We use aptimize on the staging box but it has been turned off for this particular website. I compared the page sources and they're identical! The only difference is bits of content since they are served by a CMS. Any ideas please? I'm quite stuck on this. Cheers, Dany.

    Read the article

  • Stack Overflow like Watermarks in Forms

    - by Kaushik Gopal
    Hey people, I remember seeing a tutorial somewhere that talks of how to style your input forms in a more "usable" way. Essentially, you have a placeholder value and when you enter the input, it hides the hint so to speak. Now, just to be clear: I don't want the hint (placeholder value text) to disappear onFocus, but rather to go lighter when I first start typing something. Good e.gs: Check out the forms on Aardvark http://vark.com/. This is exactly how I wish to have my input forms. Our very own stackoverflow. When you try to ask a question, on clicking inside any input form, it doesn't hide the text right away. You see your cursor as well as the hint. but when you start to type, it hides the hint(I would prefer having it go to a much lighter shade rather than hiding all together, like above example). I remember very clearly reading a tutorial somewhere on the interwebz with this exact requirement, but darn forgot to bookmark it. Any suggestions/links?

    Read the article

  • JavaScript onchange, onblur, and focus weirdness in Firefox

    - by typoknig
    On my form I have a discount field that accepts a dollar amount to be taken off of the total bill (HTML generated in PHP): echo "<input id=\"discount\" class=\"text\" type=\"text\" name=\"discount\" onkeypress=\"return currency(this, event)\" onchange=\"currency_format(this)\" onfocus=\"on_focus(this)\" onblur=\"on_blur(this); calculate_bill()\"/><br/><br/>\n"; The JavaScript function calculate_bill calculates the bill and takes off the discount amount as long as the discount amount is less than the total bill: if(discount != ''){ if(discount - 0.01 > total_bill){ window.alert('Discount Cannot Be Greater Than Total Bill'); document.form.discount.focus(); } else{ total_bill -= discount; } } The problem is that even that when the discount is more than the total bill focus is not being returned to the discount field. I have tried calling the calculate_bill function with onchange but neither IE or Firefox will return focus to the discount field when I do it like that. When I call calculate_bill with onblur it works in IE, but still does not work in Firefox. I have attempted to use a confirmation box instead of an alert box as well, but that didn't work either (plus I don't want two buttons, I only an "OK" button). How can I ensure focus is returned to the discount field after a user has left that field by clicking on another field or tabbing IF the discount amount is larger than the total bill?

    Read the article

< Previous Page | 1 2 3 4 5 6  | Next Page >