JavaScript - Problem With Script - Hidden Button Not Appearing
Hello,
I am trying to have my print button appear only once the script for my validation button has gone through without any errors. To do this, I used the following script in my validation button (I've truncated most of it since you get the point after two lines): // hidden field var lrcf = this.getField("LastRCFalse"); var ei = this.getField("Employee ID number"); if ( lrcf.value != ""){ var tempname = lrcf.value; if (tempname == "Employee ID number") {ei.setFocus();}} else { var ei = this.getField("Employee ID number"); if (ei.value != "" && (ei.value == "0000000" || ei.value < 1259)){ app.alert("Employee ID number, if entered, must be between 0001259 and 0999999") ei.setFocus();} else { var city = this.getField("Effective date"); if (city.value == ""){ app.alert("Please enter Effective date") city.setFocus();} else { var gmf = this.getField("Gender"); if (gmf.value != "M" && gmf.value != "F" ){ app.alert("Please select gender of employee") gmf.setFocus();} else { // Making fields visible for printing VisibleToPrint(); app.alert("Your form is ready to print. Please press the PRINT button on this form.",3) The red part is where it all seems to be breaking apart. I've verified that none of the script before is incorrect and it all goes smoothly except that my print button does not appear afterwards. (The print button doesn't have any complicated script just a "execute a menu item" and is put as hidden in common properties so that no one can print before having gone through the verification). Should I have created another print button which sits on top of the other one? I am really new to this so any help would be greatly appreciated. Similar Tutorialshttp://vietnamthereandback.com/mainpage.html The arrows next to the songs previews are randomly appearing/disappearing on page refresh. There are always 8 arrows, but each refresh shows the arrows in different places. This has really got me stumped. If anyone has any thoughts, I'd really appreciate hearing them. The basic button/arrow code is below. The only thing that changes in the MP3 file name. <code> <object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=10,0,0,0" width="30" height="30"> <PARAM NAME=movie VALUE="http://www.vietnamthereandback.com/Clips/audioplay.swf?file=http://www.vietnamthereandback.com/Clips/reflections.mp3&auto=no&sendstop=yes&repeat=1&buttondir=http://www.vietnamthereandback.com/Clips/buttons/negative_small&bgcolor=0xffffff&mode=playpause"> <PARAM NAME=quality VALUE=high> <PARAM NAME=wmode VALUE=transparent> <embed src="http://www.vietnamthereandback.com/Clips/audioplay.swf?file=http://www.vietnamthereandback.com/Clips/reflections.mp3&auto=no&sendstop=yes&repeat=1&buttondir=http://www.vietnamthereandback.com/Clips/buttons/negative_small&bgcolor=0xffffff&mode=playpause" quality=high wmode=transparent width="30" height="30" align="" TYPE="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer"></embed></object> </code> This is my last resort. I do not javascript - I have the code Google sent me on http://www.countyfairgrounds.net - and I have 3600 other pages I would like it on - but for the life of me - I cannot figure out why it does not work. Lately I have tried to make it work on http://www.countyfairgrounds.net/ads.html - I have tried the Google forums. Does anyone here speak Google +1 code? I surely would appreciate it
I have the following code: Quote: <form id="registration" action="/cgi-bin/registration.cgi" method="POST" onsubmit="return control()"> <fieldset> <legend>Fill up this module</legend> Private <input id="private" type="radio" name="type" value="private" onclick="return addPrivate()"/><br/> Community/Organization <input id="organization" type="radio" name="type" onclick="alert('Organization')"/><br/> <br/> and the following script: Quote: addPrivate() { alert('Private'); } but alert windows doesn't not appear. Where is the problem? Hi all, Only recently started, self-teaching, html and Java in order to get a project idea of mine up and running. First barrier I've come across is trying to sort out a drop down with search button that will then reveal the connected hidden div, I've mangled together some code from a couple of sources with what I've learnt, but not really sure how to tie in the "Search" button to the showDiv(divname) function. Wondering if anyone could help out. Many thanks in advance Code: <head> <title>Untitled</title> <link rel="stylesheet" type="text/css" href="stylesheet.css" /> <script type="text/javascript"><!-- var lastDiv = ""; function showDiv(divname) { if (lastDiv) { document.getElementById(lastDiv).className = "hiddenDiv"; } if (divName && document.getElementById(divName)) { document.getElementById(divName).className = "visibleDiv"; lastDiv = divName; } } </script> </head> <body> <h1> <form name="form" > <select name="select"> <option selected>Choose <option value="one"> one <option value="two"> two <option value="other"> other </select> <input type="button" value="Search" onClick="showDiv(this.value)"> </form> </h1></br> <h2> Results: <p id="one" class="hiddenDiv">one</p> <p id="two" class="hiddenDiv">two</p> <p id="other" class="hiddenDiv">other</p> </h2> </body> </html> From my stylesheet: Code: .hiddenDiv { display: none; } .visibleDiv { display: block; } Hello, I am pretty new at javascript and I am trying to create a payment form that has both fields for payment by check and payment by credit card. I am wondering how I would go about having a radio button that asks the user how they would like to pay "credit card" or "check" and depending on which one they pick it shows the fields pertaining to that type of payment. the fields in the form look like this: Credit Card Fields: Code: <select name="card_type" size="1"> <option value="">- Card Type - </option> <option value="1">Visa</option> <option value="2">Mastercard</option> <option value="3">Discover</option> <option value="4">American Express</option> </select> Expiration Date<input type="text" name="exp_date" value="" id="exp_date"> CVC Code<input type="text" name="cvc" value="" id="cvc"> Card Number<input type="text" name="card_number" value="" id="card_number"> Amount On Credit Card<input type="text" name="card_amount" value="" id="card_amount"> Name On Card<input type="text" name="name_on_card" value="" id="name_on_card"> Billing Address<input type="text" name="billing_address" value="" id="billing_address"> Billing City<input type="text" name="billing_city" value="" id="billing_city"> <select name="billing_state" size="1"> <option value="">- Billing State -</option> </select> Check Fields: Code: Name (as printed on check)<input type="text" name="check_name" value="" id="check_name"> Address On Check<input type="text" name="check_address" value="" id="check_address"> Amount On Check<input type="text" name="check_amount" value="" id="check_amount"> Checking Account Number<input type="text" name="check_acc_number" value="" id="check_acc_number"> Routing Number<input type="text" name="routing_number" value="" id="routing_number"> Check Number<input type="text" name="check_number" value="" id="check_number"> I thought this would have been fairly simple but it appears the onchange event isn't triggered when a hidden field is populated by other javascript without user input. I have a simple search box and autocomplete/suggestion ajax thingie going on. What I want to do is have my "Go" submit button disbled until AFTER a user has populated the hidden field "cid". A user populates this field automatically when they click on a suggested option from the ajax autocomplete doofer. Here's what I've tried at the moment but failed on. Code: <form action="index.php" method="GET" name="qsform" id="qsform"> <input type="hidden" name="p" id="p" value="compdetails" style="border:1px solid #000000;" /> <input type="text" name="quicksearch" id="quicksearch" value="Find Company" style="border:1px solid #000000;" onFocus="clearText(this)" onBlur="clearText(this)" /> <input type="hidden" name="cid" id="cid" value="" style="border:1px solid #000000;" /> <input type="submit" name="go" id="go" value="Go" disabled="true" onmouseover="if (document.qsform.cid.value!='') { document.qsform.go.disabled=false; }" /> </form> I checked the code for hours and I can't figure out why the form doesn't work. Please, I need help, I need to finish this page. Inside the input form there is a div using visibility:hidden. The div works perfectly when it is selected (show or hide), not problem. The problem is when press the send button the form doesn't send anything, not respond, do nothing!. Any help? Dear Javascript programmers, Do you have an example of a Javascript something like this: A dropdownlist with values "one" and "two". The radio button is not visible (as a start). - If you have selected "one" from the dropdown list, then a radio button will appear. - If you have selected "two" from the dropdown list, then a radio button will NOT appear. Thanks, Cornelis Gouda - The Netherlands I have a slideshow of quotes based on the "Ultimate Fade-in slideshow (v2.1)" at Dynamic Drive: http://www.dynamicdrive.com/dynamici...nslideshow.htm This is right under my navigation bar, and the drop-down menu items are hidden behind the javascript slideshow. You can see it he http://brookenelson.com/upticon/draft3/index.html Some background: The reason I did it this way because I first started out with a Flash banner with quotes fading in and out, and I ran into the problem with the drop-down menu items hiding behind the Flash... of course I Googled that and found the solution ( see he http://brookenelson.com/upticon/draft3/index2.html ) But in the meantime I played with the javascript slideshow and it worked better for me because it was easier to add new quotes just within the html, without having to go back and edit the Flash item. Anyway, so is there a solution to the drop-downs being hidden behind the .js slideshow? Or should I go back to the Flash? Or is there some other sort of solution or script that would fit my needs better? Many many many thanks in advance. p.s. I personally do not like the little quote slideshow I am using, in either form, but the client is insisting on it!! hello, i have a form in my header that is hidden and i have it show when you click a link, the problem is, when the form appears, it pushes everything down below it, any ideas on how to get around this?
I would like to make an ordered list, for example: 1. Airplane 2. Boat 3. Car I'd like one of the words to be displayed on my webpage, for example: Boat Then I'd want an up button, and a down button. The up button would display Airplane instead of Boat, and the down button would display Car instead of Boat. Once it got to Car, the same up button would change it back to boat. How do I do this? Thanks. i am getting a problem while passing parameter to another 'jsp' through hidden variables.I am getting null while requesting the parameter in 'mywindow.jsp' my code goes like this <form name="name" enctype="multipart/form-data"> <input type="hidden" name="flag" id="flag" value=""/> ........ </form> setting its value in javascript.. like this.. <script type="text/javascript"> function openNewWindow(){ var flag1="1"; document.getElementById("flag").value=flag1; document.tstForm.action = "Mywindow3.jsp"; document.tstForm.method = "POST"; document.tstForm.submit(); } </script> in mywindow.jsp:: <% String strFlag = request.getParameter("flag"); out.println("strFlag:"+strFlag); %> i am getting "null" as value of strFlag.I need to use enctype as "multipart/form-data" to submit form. I'm having a problem using javascript with a form. I'm using javascript to determine whether or not a person has selected "yes" or "no" from the select list. If "yes" is selected, the form is supposed to slide down and reveal two more fields. If "no" is selected, the form is supposed to slide back up hiding those two fields again. When "yes" is selected, the form displays the two new fields properly. In Safari, it does the slideDown animation, yet in Firefox, the new form fields just suddenly display. If I select "no" again, nothing happens. The slideUp animation doesn't play. So currently I am having to use $("#parent1").hide(); to get the "no" to trigger. So my two questions a 1. Is there any reason the slide animation plays smoothly in Safari but not in Firefox? 2. Why won't $("#parent1").slideUp("fast"); work when I select "no?" http://megandmatt.fernandwilbur.com/rsvp.php Any help would be greatly appreciated. /** The <a> is a list of menu items that when clicked.... a specific gallery-slider-images should been shown in relation to the galleryId....<div class"gallery" is hidden in CSS> I'd like to use jQuery to complete this task if at all possible, I know it's prob SIMPLE to U GURU's but being new i can't seem to .show() the selected 'gallery' w/o showing them all........... BEST REGARDS _ STH <div id="gallery-menu"> <?php foreach ($galleries as $gallery) : ?> <a onclick="showGallery(<?= $gallery['gallery']['id'] ?>); return false;"><?= $gallery['gallery']['name'] ?> <?php endforeach ?> </div> <?php foreach ($galleries as $gallery): ?> <div id="<?= $gallery['gallery']['id'] ?>" class="gallery"> <div class="slider" style="width; 100%; height: 100%;"> <ul> <?php foreach ($gallery['images'] as $image): ?> <li class="galleries-container"> <img src="<?= UCMVC_APP_BASE_URL ?>/gallery/retrieve-image/<?= $image['id'] ?>" alt="<?= $image['name'] ?>" title="<?= $image['name'] ?>" /> </li> <?php endforeach; ?> </ul> </div> </div> <?php endforeach; ?> // javascript // function showGallery(galleryId) { ????!?!?!?!?! } Hello, I've been working on creating a script that zooms the entire webpage. Other than using "CTRL" + "+" keys (generally compatible with all browsers) to zoom in inside a web browser, I want to put it in a different format, as a button; it would be even easier to use. The problem is that I can't figure out how to make it work/ why it does not work. The following is my code: Code: <html> <head> <script type = "text/javascript"> document.onkeydown = function(zoomin) { var key; zoomin = zoomin || event; key = zoomin.keyCode; key == 43; return false; if (key == 17) { return true; function(zoomin){; return false; } } }</script> </head> <body> <h1>Is this appearing to get bigger?</h1> <button onclick="javascript: function('zoomin');">Zoom in</button> </body> </html> Basically I was trying to use a DEC code as the code for the "CTRL" and "+" keys; then put them into a function. The "return true" under the IF statement means that I want it to hold so that the "+" key can be read as part of the script, and therefore make the page zoom in. Once that happens, it returns false. I would appreciate any help/ suggestions. I will also try to look for a way to reset the page (100%) or zoom out as well. Hi Guys, I was wondering if I could have some help. Its coding for the left side of a frame set to display in the right side. Im pulling my hair out! Thanks Code: <html> <head> <script type="text/javascript"> function go() { var go="none"; if (document.buttons.option[0].checked) go=button.option[0].value; if (document.buttons.option[1].checked) go=buttons.option[1].value; if (document.buttons.option[2].checked) go=buttons.option[2].value; parent.rightframe.location=go; } </script> </head> <body> <form name="buttons" id="buttons"> <input type="radio" name="option" value="cit.html" checked="checked">CIT</input> <br /> <input type="radio" name="option" value="currency.html">Currency</input> <br /> <input type="radio" name="option" value="staffsurvey.html">Staff Survey</input> <br /> <input type="radio" name="option" value="game.html">Game</input> <br /> <input type="button" value="Go" onClick="go();"</input> </form> </body> </html> I wanted to make it so that a button on the webpage validates a word that a user types into a prompt box that pops up when they open the webpage. For example, user goes on website, prompt box opens, user types in word then presses OK. On the webpage he clicks the button, which calls a while function to check if the word has a P at the start, a J somewhere in it, and is longer than 8 characters. Code: <script type="text/javascript"> var strWord; function validateWord() { while(strWord == document.formname.validateWord.value.length > 8 && var iChars = "JP";) { "alert(Correct)" value="Word Alert"> } } </SCRIPT> I've been trying this script but with no luck and cant tell whats wrong with it. Any ideas? Hi Everyone, I want to execute a script when the user clicks the button. Currently in my html doc. i have the button declared. <input type="button" id ="button" onclick='notEmpty() value="Play"/> When the button is clicked, i execute the notEmpty() function and I want to execute a script inside the notEmpty(). How can i do this? Thanks, Praveen I am a new to js and GM but I am trying to make a script that will click a button on a page where there are multiple instances of the button. The source I am looking at is below and I have narrowed down what I am looking at to the bold section. <dl> <dd class="left"><div id='recommendstatus_article4458331'> <dl class="recommend"> <dt class='recs'><a href="javascript://" onclick="RecSpy( 'article', '4458331', 'tippers' ); return false;">50</a> </dt> <dd><a href="javascript:void(0);" onclick="RecommendItem(1,'article','4458331','1','recommendstatus_article4458331' ); return false;" onmouseover="return overlib('Give thumbs up', WRAP);" onmouseout="return nd();"> <img class='icon' title='' alt='Thumb up' style='background-position: -304px -48px;' src='http://geekdo-images.com/images/pixel.gif' /></a></dd> <dt class='tippers'><a href="javascript://" style='color: #969600;' onclick="RecSpy( 'article', '4458331', 'tippers' ); return false;"></a></dt> <dd><a href="javascript:void(0);" onmouseover = "return overlib( 'GeekGold Tip', WRAP );" onmouseout = "nd();" onClick="GeekGoldTip(0,'article','4458331','recommendstatus_article4458331'); return false;"> <img class='icon' title='' alt='tip' style='background-position: -368px -48px;' src='http://geekdo-images.com/images/pixel.gif' /></a></dd> <dd> <a href="javascript:void(0);" onclick="RecommendItem(0,'article','4458331','','recommendstatus_article4458331', 'article4458331' ); return false;" onmouseover="return overlib('Hide this post', WRAP);" onmouseout="return nd();"> <img class='icon' title='' alt='Thumb up' style='background-position: -336px -48px;' src='http://geekdo-images.com/images/pixel.gif' /></a> </dd> <dt class='thumbsdown'> </dt> </dl> How do I create a script to find each instance of the button and click it? Hi all, I would like to have an HTML button which, when clicked by the user, contacts the server and runs a Python script on the server. When the Python script finishes running, the current HTML page automatically reloads a file from the server. Is that possible? YJ |