JavaScript - Make Image A Button To Trigger Code?
I have some code that will check a users screen resolution and open a new window with a particular version of my website in, I have several sites for different page sizes. But when this code runs in Safari the pop-up is blocked so I would like the image on my page to be a button that runs the code to open the 'correct' window (based on the screen res) and as a button is launching the new window Safari should be okay about it.
Unless I am doing something wrong? http://www.meta.projectmio.com/pop.html But how do I modify the code to do this, I'm hopeless? Thanks. Similar TutorialsI am quite unexperienced in javascript (my only related experience is work with actionscript), so this problem is likely extremely simple. I am trying to alter a bit of code from a Firefox Jetpack extension (ClicktoFlash, if that helps) to suit my needs, and am having some trouble executing a time based event. The pertinent section of the extension's code is as follows: Code: placeHolder.click(function(eventObject){ $(this).replaceWith(jQuery.data( placeHolder, "myEmbed") ); }); The bit of code executed within the function is what I wish to maintain, but I want the code to instead be executed within a certain timeframe. My makeshift attempt to alter the code read like this: Code: var currentTime = new Date(); var hour = currentTime.getHours(); if((hour >= 2) && (hour < 7)){ $(this).replaceWith(jQuery.data( placeHolder, "myEmbed") ); }; This didn't work quite like I had hoped (though I think the code itself is solid), and I think under the circumstances I might need to replicate the placeHolder.click() segment while 7>hour>=2 for the code to execute properly; however, I am having quite a bit of trouble trying to do this. In short, is it possible to trigger a button press without the mouse ever clicking the button, or is there a glaringly apparent easier solution that I'm missing? Thanks in advance. Hello, I need your help. I basically need, when the enter button is pressed on the keyboard to trigger a button. Currently, my code works but it just refreshes the page and does not actually trigger the desired button: Code: //HERES MY CUSTOM BUTTON: <BUTTON TYPE="submit" onMouseOver="goLite(this.name)" onMouseOut="goDim(this.name)" onclick="javascript:v7_search()" CLASS="btn_std" NAME="btn_search" > ? Search </BUTTON> Here's the code to make the enter button work: Code: <form name="frmIMTS" onkeydown="javascript:if (event.which || event.keyCode){if ((event.which == 13) || (event.keyCode == 13)) {document.getElementById('btn_search').click();}};" > Any help with this is greatly appreciated. Cheers, J Code: <fieldset class="submit" style="padding-left: 200px;"> <?php if ($site_exist >= 1){ echo "<input type=\"submit\" name=\"submit\" value=\"Update\">"; } else { echo "<input type=\"submit\" name=\"submit\" value=\"Submit\">";} ?> <!-- This is the button I am having trouble with. --> <input type="button" name="delete" value="Delete" onClick="return confirmSubmit()"> </fieldset> </form> <script type="text/javascript"><!-- function confirmSubmit(){ var agree=confirm("Are you want to delete this site from our index?"); if (agree) return true ; else return false ; } // --> </script> Not entirely sure which forum this should go in, since the problem could probably be fixed with HTML, PHP or Javascript. Anyway, I have the confirmation window working. What I need is for the button to post a variable (siteDelete = 'true') when it is pressed. I would prefer to do that part without javascript, but I want the data to be posted after and only after the confirmation window returns true. I can do that with a submit button, but I'm not sure what code to use and where to use it when using a non-submit button. hi, on my website http://zend.warrencreative.com/gemini-group/index.html I am using thickbox, if you click on Subscribe to newsletter at the top it opens up a box, I need to change type="button" to type="image" but this doesn't work?! is there any other way? Code: <a class="newsletter thickbox" href="#TB_inline?height=325&width=365&inlineId=myOnPageContent&modal=true">Subscribe to eNewsletter</a> <div id="myOnPageContent" class="hidden"><p>Please enter your Name:</p><p><input type="text" name="name" class="textbox"></p><p>Please enter your Email:</p><p><form action="#"><input type="text" name="email" class="textbox"></p><p> </p><p><input type="button" value="Send" class="thickbox" title="add a caption to title attribute / or leave blank" alt="#TB_inline?height=325&width=365&inlineId=myOnPageContent1"> <input onclick="tb_remove()" type="image" alt="cancel button" src="images/cancelbutton.jpg"></form></p></div> <div id="myOnPageContent1" class="hidden"><p>Thank you for subscribing</p><input onclick="tb_remove()" type="image" alt="cancel button" src="images/cancelbutton.jpg"></div> thanks in advance here is the html code that i have PHP Code: <td valign="middle" valign="middle"> <input type="radio" name="gender" id="genderM" value="Male" /> Male <input type="radio" name="gender" id="genderFM" value="Female" /> Female </td> and here is the js funtion PHP Code: var $j = jQuery.noConflict(); function isValidEmail(str) { return (str.indexOf(".") > 2) && (str.indexOf("@") > 0); } function validateForm(){ var firstName; var lastName; var email; var mobile; var comment; var error; firstName = $j('#firstName').val(); lastName = $j('#lastName').val(); email = $j('#email').val(); mobile = $j('#mobile').val(); comment = $j('#comment').val(); if(firstName=='' || firstName.length < 3){ error = 'Please Enter Your First Name'; $j('#errormsg').html('<p class="errors">'+ error +'</p>'); return false; } if(lastName=='' || lastName.length < 3){ error = 'Please Enter Your Second Name'; $j('#errormsg').html('<p class="errors">'+ error +'</p>'); return false; } //mob //$jmob_pattern = '^\d{10}$j'; if(mobile.length != 10 || isNaN(mobile)){ error = 'Please Enter Your Mobile Number'; $j('#errormsg').html('<p class="errors">'+ error +'</p>'); return false; } if(email=='' || !isValidEmail(email)){ error = 'Please Enter Your Email Address'; $j('#errormsg').html('<p class="errors">'+ error +'</p>'); return false; } if(comment.length < 5){ error = 'Please Enter A Comment'; $j('#errormsg').html('<p class="errors">'+ error +'</p>'); return false; } return true; } Does anybody know how i check to see if the radio button is select and also can anybody tell me how i can check for an email in the correct format the function isValidEmail in the above alows emails to pass through if they are in this format aaa@aaa. i only want them to go through if they are aaa@aaa.com Thanks for your help if you give it I'm trying to get my Client Side Firefox DHTML app to display a list of eBooks. For this, i have the following files F:\Textbooks.html F:\eBooks.txt F:\FirstBook.txt F:\SecondBook.txt F:\ThirdBook.txt textbooks.html is my DHTML app eBooks.txt is the Library file with a listing of all of my eBooks. Inside of eBooks.txt is the following data: ----------------- FirstBook.txt, SecondBook.txt, ThirdBook.txt, ----------------- FirstBook.txt to ThirdBook.txt are my actual ebooks. The problem that i'm having is that When i try to click on any buttons other than the FirstBook button, i get the following error: ---------------------------------- Error: unterminated string literal Source File: file:///F:/Textbooks.html Line: 1, Column: 10 Source Code: LoadEbook(' ---------------------------------- So, unlike clicking on the FirstBook button, these other buttons do not load the eBook data into the DIV for displaying the eBook data. I use the DOM insepector to checkout the DOM of the button code, and it seems like whitespace maybe is the problem. However, i have removed whitespace from the HTMLdata string, and that's not fixing the problem. did i forget something silly? LOL i'm using FireFox 3.5 to develop this App. So obviously this will not work with anything other than Gecko Based browsers. here is my HTML code: <html> <head> <script language="JavaScript"> var eBookLibrary = "eBooks.txt"; var SystemPath = "f:" + String.fromCharCode(92) function Init() { // Initialize the eBook reader document.getElementById("EbookCanvas").style.visibility = "hidden"; document.getElementById("EbookToolbar").style.visibility = "visible"; document.getElementById("FileManager").style.visibility = "visible"; // Load the List of eBooks in the Library LoadBookList(); } function UpdateEbookList() { // Update the Library of Ebooks alert("Updating eBook Library"); // Go back to the File Manager, and Reload the List of Ebooks LoadBookList(); } function LoadBookList() { // This will load the list of books that are available var EbookList = LoadFromDisk(SystemPath + eBookLibrary); var EbookListArray = EbookList.split(","); for(var x = 0; x < EbookListArray.length -1; x++) { // Strip the Filename Extension off of the eBook File Name // The Name of the Book is always the first Index in the Array var BookName = EbookListArray[x].split("."); // Remove the weird whitespace - it screws things up...i think... BookName[0] = BookName[0].replace(/(^\s*|\s*$)/g, ""); var HTMLdata = HTMLdata + "<input type='button' value='" + "FirstBook" + "'" + " onClick=LoadEbook('" + EbookListArray[x] + "');><br>"; } // For some ****ed up reason the first string always generates an 'undefined' even though it's nonsense // So just delete that from the HTMLdata string, because it's just ugly - LOL HTMLdata = HTMLdata.replace("undefined", ""); HTMLdata = HTMLdata.replace("", " "); // Write the HTML data to the DIV document.getElementById("FileManager").innerHTML = HTMLdata; } function LoadEbook(EbookName) { // Hide the File Manager and Show the Ebook Canvas document.getElementById("FileManager").style.visibility = "hidden"; document.getElementById("EbookCanvas").style.visibility = "visible"; document.getElementById("EbookToolbar").style.visibility = "visible"; // Load the Ebook content into the Ebook Reader Pannel var EbookContent = LoadFromDisk(SystemPath + EbookName); document.getElementById("EbookCanvas").innerHTML = EbookContent; } function LoadFromDisk(filePath) { if(window.Components) try { netscape.security.PrivilegeManager.enablePrivilege("UniversalXPConnect"); var file = Components.classes["@mozilla.org/file/local;1"].createInstance(Components.interfaces.nsILocalFile); file.initWithPath(filePath); if (!file.exists()) return(null); var inputStream = Components.classes["@mozilla.org/network/file-input-stream;1"].createInstance(Components.interfaces.nsIFileInputStream); inputStream.init(file, 0x01, 00004, null); var sInputStream = Components.classes["@mozilla.org/scriptableinputstream;1"].createInstance(Components.interfaces.nsIScriptableInputStream); sInputStream.init(inputStream); return(sInputStream.read(sInputStream.available())); } catch(e) { //alert("Exception while attempting to load\n\n" + e); return(false); } return(null); } </script> </head> <body onLoad="Init();"> <div id="FileManager" style="position: absolute; top: 0px; left: 0px; visibility: visible;"> The eBook Library's List of Books will be listed here. Click on one to open it in the eBook Reader </div> <br> <div id="EbookCanvas" style="position: absolute; top: 0px; left: 0px; visibility: hidden;"> </div> <br> <div id="EbookToolbar" style="position: absolute; top: 100px; left: 0px;"> <input type="button" value="Open" OnClick="Init();"> <input type="button" value="Update" OnClick="UpdateEbookList();"> <input type="button" value="Exit" OnClick="MainMenu();"> </div> </body> </html> Made a topic earlier about "auto klick" for swf button but i got response ,its not posible todo that.. so i have another question!! Is it posible to make the swf button invisible but still clickable and then have a background so it looks like its another button? or is there any other way to edit design for the button! OBS! i only have the swf not the flv file! Code: <html class="no-js" lang="en" xmlns:og="http://opengraphprotocol.org/schema/" xmlns:fb="http://www.facebook.com/2008/fbml"> <!--<![endif]--> <head> <meta charset="utf-8"> <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1"> <script src="http://www.google.com/jsapi?key=ABQIAAAAAJ5I0tmbz-jcO3Ja4fwvEBTb9u7IFi28hLXI-qXjI6UBBcarTBQ49g-wp7Wxnow1_w9F-7_GcOOnyg"></script> <script> google.load("jquery", "1.7.0"); google.load("swfobject", "2.2"); </script> </head> <body> <div id="container"> <div id="main" role="main"> <div id="data" class="channel"> <div id="openbutton"> <div id="flashcontent1";></div> <!-- DR1 Start --><script> params = {}; params.text = 'DR1'; params.action = "channel"; params.value = "40"; swfobject.embedSWF('content/linkbutton.swf', 'flashcontent1', '145', '30', '9.0.115', 'content/expressinstall.swf', params, {allowFullscreen:'true', wmode: 'transparent' ,bgcolor: '#FFFFFF', menu: 'false'}, {id: 'flashcontent1'}); <!-- DR1 Ends --></script> </div></div></div> </div></body></html> I'm trying to create a button where I can click on it and it changes the colour of text. When I click the same button again, it will change the text to another colour. It would be helpful if someone could show me how to do it please.
Basically, I want to make it so there is a button, and when you click it, it plays a random song from a list of songs that would be in the code. I am not completely sure if this is possible or not. I know how to make the button, that is simple. Sorry if this is actually easy, I am just learning how to script. how do i make a html button stay down when pressed, until another button within a specified group of buttons is pressed, at which point it is released and the other button stays pressed?
I have a button given like this: <a href="test.php"><input class="test" type="test"></a> I have a CSS that defined the button as an image, and on hover the button changes. However, on hover, I'd like there to come a drop down that for example link to test 1, test 2, test 3. Is this possible? Thank you! Here's the code. what am I missing to make this work? Thank you in advanced! @if (Model.Layer.Id > 0){ <div style="float: left; padding-left: 14px;"> @using (Html.BeginForm("Delete", "Layer", new { layerId = Model.Layer.Id, subAccountId = Model.SubAccount.Id })){ <input type="image" src="/Portal/Content/images/admin-delete-off-btn.png" onmouseover="this.src='/Portal/Content/images/admin-delete-on-btn.png'" onmouseout="this.src='/Portal/Content/images/admin-delete-off-btn.png'" title="Delete button" value="Delete" alt="Delete" /> } </div> } <div class="clear"></div> <div id="dialogDeleteBox" title="Delete Confirm" style="display: none"> <span class="ui-icon ui-icon-alert" style="float: left; margin: 0 7px 40px 0;"></span> <div id="confirmDeleteLayer"> <div id="confirmDeleteLayerMessage"> <p> Are you sure you want to delete this group? </p> </div> </div> </div> Hi! Trying to get a delete confirm dialog box to open when you click on the button. Here's what I have in the body... @if (Model.Layer.Id > 0){ <div style="float: left; padding-left: 14px;"> @using (Html.BeginForm("Delete", "Layer", new { layerId = Model.Layer.Id, subAccountId = Model.SubAccount.Id })){ <input type="image" src="/Portal/Content/images/admin-delete-off-btn.png" onmouseover="this.src='/Portal/Content/images/admin-delete-on-btn.png'" onmouseout="this.src='/Portal/Content/images/admin-delete-off-btn.png'" title="Delete button" value="Delete" alt="Delete" /> } </div> } I can't seem to figure out the script to make this work. Can anyone help? What I had was <script type="text/javascript"> function confirmDeleteSelected(id) { jQuery("#dialog-confirmDelete").dialog({ closeOnEscape: false, resizable: false, width: 250, modal: false, zIndex: 5000, buttons: { "Yes": function () { doDeleteSelected(id); jQuery(this).dialog("close"); jQuery(this).dialog("destroy"); }, "No": function () { jQuery(this).dialog("close"); jQuery(this).dialog("destroy"); } } //end Buttons }); } </script> Thanks Phil Code: Quote: Code: Quote: Code: Quote: can somebody please tell me what need done. Everything is working fine except for the button created in javascript that is in the second window which is to open the third window. Thanks. Hello, I am currently learning JS and want to use the following to add a counter alongside the "Items Remaining" to countdown from 5 then once the max number has been reached my button to disappear and it say "finished". Can anyone help me please? Code: <!doctype html> <html> <head> <title>Adding Numbers Together</title> </head> <body> <form id = "frmOne"> <table border="1" > <tr> <th> Items Remaining </th> <td><Input Type="Text" Name="val" > </td> </tr> <tr> <th> Number One:</th> <th> Number Two:</th> </tr> <tr> <td> <Input Type="Text" Name="txtFirstNumber" Size="5" value=""> </td> <td> <Input Type="Text" Name="txtSecondNumber" Size="5" value=""> </td> </tr> <tr> <td colspan="2"> Totals: <textarea Name="totals" style="width: 400px; height: 300px;"></textarea></td> </tr> <tr> <td colspan="2"> <Input Type="Button" Name="b1" Value="Add Numbers" onClick = calculate()> </td> </tr> </table> </form> <script> var Totals = [ ]; function calculate() { var form = document.getElementById("frmOne"); var A = form.txtFirstNumber.value; var B = form.txtSecondNumber.value; Totals.push( A + " + " + B + " = " + (1*A+1*B) ); form.totals.value = Totals.join("\n"); form.txtFirstNumber.value = form.txtSecondNumber.value = ""; } </script> </body> </html> i got javascripts button : Code: <input type="button" value="select" onClick="document.getElementById('input').select()" /> how can i transform "button" to image button (gif) Ok so im new to javascript and I have a button in an interface for an app. It's like drag and drop and i want this button to link you to a certain website searching for what the user types in the searchField1 box. The button is button16. Such as you type dogs into the text box and you click the google button among other search engines and it will redirect you to a google search doing a search for dogs. But how do I make this button search google and search for whats in searchField1. I would really appreciate the help. Im looking everywhere to learn this but just cant find it. If you could tell me how or send me a link to a tutorial that would be great. Thanks! Here is the code: I don't know where and what to add to do that. Please help. Here are the coding.. Code: <jsp:useBean id="chequeStopBean" scope="session" class="my.com.infopro.ibank.ui.bean.ChequeStopBean"/> <jsp:useBean id="labelBean" scope="session" class="my.com.infopro.ibank.ui.bean.LabelBean"/> <jsp:useBean id="lang" scope="session" class="my.com.infopro.ibank.ui.bean.LanguageBean" /> <%@ page language="java" import = "java.util.*" errorPage="" %> <%@ page import="my.com.infopro.ibank.dto.ChequeDTO"%> <% request.getSession(true); String contextPath = request.getContextPath(); chequeStopBean.queryAccList(); //RequestDispatcher dispatcher = null; %> <html> <head> <title><%=labelBean.getLabel("STOP_CHEQUE")%></title> <meta HTTP-EQUIV="Pragma" content="no-cache"> <meta HTTP-EQUIV="Expires" content="-1"> <jsp:include page="/ScriptHeader.jsp"/> <script language="javascript"> function validateAndSubmit() { var msg1 = "<%=labelBean.getLabel("MSG_REQUIRED_FIELD")%>"; var msg2 = "<%=labelBean.getLabel("MSG_CANNOT_CONTAIN_CHARACTER")%>"; var msg3 = "<%=labelBean.getLabel("MSG_IN_THE_FIELD")%>"; var msg4 = "<%=labelBean.getLabel("MSG_PLEASE_ENTER")%>"; var msg5 = "<%=labelBean.getLabel("WITH")%>"; var msg6 = "<%=labelBean.getLabel("TO")%>"; var msg7 = "<%=labelBean.getLabel("MSG_CHARACTER")%>"; var msg8 = "<%=labelBean.getLabel("MSG_PLEASE_ENTER_VALID_NUMBER")%>"; var msg9 = "<%=labelBean.getLabel("MSG_REQUIRED_FIELD")%>"; var msg10 = "<%=labelBean.getLabel("MSG_WITH_EXACTLY")%>"; var msg11 = "<%=labelBean.getLabel("MSG_WITH_VALID_DATE")%>"; var msg12 = "<%=labelBean.getLabel("MSG_EXAMPLE_DATE")%>"; var msgNum11 = "<%=labelBean.getLabel("MSG_WITH_A_MINIMUM_VALUE_OF")%>"; var msgNum12 = "<%=labelBean.getLabel("MSG_WITH_A_MAX_VALUE_OF")%>"; var msgNum13 = "<%=labelBean.getLabel("MSG_PLEASE_ENTER_ROUND_INETEGER")%>"; var msgNum14 = "<%=labelBean.getLabel("MSG_PLEASE_ENTER_AT_MOST")%>"; var msgNum15 = "<%=labelBean.getLabel("MSG_DECIMAL_PLACES")%>"; var msgEnter = "<%=labelBean.getLabel("MSG_PLEASE_ENTER_VALID")%>"; var errorMsg = "<%=labelBean.getLabel("MSG_LOWECASE_ALPHABET_ALLOWED")%>" var radioButtons = document.getElementsByName("radio"); for (var x = 0; x < radioButtons.length; x ++) { if (radioButtons[x].checked) { if(radioButtons[x].value=="1") { if (! validateTextEntry(form.chqNum, "<%=labelBean.getLabel("CHQNUM")%>" + " ", true,11,11, msg1, msg2, msg3, msg4, msg5, msg6, msg7, msg10) ) return false; if (! validateAlphabet(form.chqNum, "" + " ",1, msg2,"" )) return false; } else if(radioButtons[x].value=="2") { if (! validateTextEntry(form.chqNumFrom, "<%=labelBean.getLabel("CHQNUMFROM")%>" + " ", true,11,11, msg1, msg2, msg3, msg4, msg5, msg6, msg7, msg10) ) return false; if (! validateTextEntry(form.chqNumTo, "<%=labelBean.getLabel("CHQNUMTO")%>" + " ", true,11,11, msg1, msg2, msg3, msg4, msg5, msg6, msg7, msg10) ) return false; if (! validateAlphabet(form.chqNumFrom, "" + " ",1, msg2,"" )) return false; if (! validateAlphabet(form.chqNumTo, "" + " ",1, msg2,"" )) return false; if(form.chqNumFrom.value == form.chqNumTo.value){ alert("<%=labelBean.getLabel("MSG_CANNOT_SAME")%>"); return false; } } } } return true; } function show(id) { if (document.getElementById(id).style.display == 'none') { document.getElementById(id).style.display = 'block'; } } //--> <!-- function hide(id) { document.getElementById(id).style.display = 'none'; } </script> </head> <body onload="show('single')"> <form name="form" method="POST" action="<%=contextPath%>/ChequeStopServlet?tranx=confirm" dir="<%=lang.getDir()%>" > <table width="500" align="center"> <tr> <td align="left" colspan="3"> </td> </tr> <tr> <td align="left" colspan="3" class="mainHeader"><%=labelBean.getLabel("STOP_CHEQUE")%></td> </tr> <tr> <td colspan="3"> </td> </tr> <tr> <td colspan="3" class="subHeader"><%=labelBean.getLabel("CHQ_DETAIL") %></td> </tr> <tr> <td colspan="3"><div align="center"> <p class="statusError"> <%if(request.getParameter("error") != null) out.println(labelBean.getLabel(request.getParameter("error"))); else out.println("");%> </p> </div></td> </tr> </table><br /> <table width="500" align="center"> <tr> <td class="lbl"><span class="requiredFieldIndicator">* </span><%=labelBean.getLabel("ACC_NUMBER")%></td> <td width="10" class="lbl">:</td> <td width="305" align="left"> <select size="1" name="accNum"> <% for (Iterator iter = chequeStopBean.getAccList().iterator(); iter.hasNext();) { ChequeDTO chqDto = (ChequeDTO)iter.next(); %> <option value="<%=chqDto.getAccNum()%>"><%=chqDto.getAccNum()%></option> <% } %> </select> </td> </tr> <tr> <td align="right"> <input type="radio" class="radioStyle" name="radio" value="1" onfocus="show('single');hide('multiple');hide('multiple1');return true;" checked="checked" > <%=labelBean.getLabel("STOP_SINGLE")%> </td> <td> </td> <td> <input type="radio" class="radioStyle" name="radio" value="2" onfocus="hide('single');show('multiple');show('multiple1');return true;"> <%=labelBean.getLabel("STOP_MULTIPLE")%> </td> </tr> <tr id="single"> <td class="lbl"><span class="requiredFieldIndicator">* </span><%=labelBean.getLabel("CHEQUE_NUMBER")%></td> <td class="lbl"width="10">:</td> <td colspan="2" align="left"> <input name="chqNum" type="text" size="15"> </td></tr> <tr id="multiple" style="display: 'none'"> <td class="lbl"><span class="requiredFieldIndicator">* </span><%=labelBean.getLabel("FROM_CHEQUE_NUMBER")%></td> <td class="lbl"width="10">:</td> <td colspan="2" align="left"> <input name="chqNumFrom" type="text" size="15"> </td></tr> <tr id="multiple1" style="display: 'none'"> <td class="lbl"><span class="requiredFieldIndicator">* </span><%=labelBean.getLabel("TO_CHEQUE_NUMBER")%></td> <td class="lbl"width="10">:</td> <td colspan="2" align="left"> <input name="chqNumTo" type="text" size="15"> </td></tr> <tr> <td class="lbl"><span class="requiredFieldIndicator">* </span><%=labelBean.getLabel("REASON")%></td> <td class="lbl" width="10" >:</td> <td colspan="2"> <select name="reason"> <option value="Lost"><%=labelBean.getLabel("LOST")%></option> <option value="Stolen"><%=labelBean.getLabel("STOLEN")%></option> <option value="Payment Cancellation"><%=labelBean.getLabel("PAYMENT_CANCELLATION")%></option> <option value="Others"><%=labelBean.getLabel("OTHERS")%></option> </select> </td> </tr> <br/> <tr> <td colspan="3"> </td> </tr> <tr> <td colspan="3" align="center"> <input class="button" type="submit" value="Next" onClick="return validateAndSubmit();" > </td> </tr> <tr> <td colspan="3"> </td> </tr> <tr> <td colspan="3" align="left" class="footer"><%=labelBean.getLabel("NOTE")%> </td> </tr> <tr><td colspan="3" class="footer"> <ul> <li><%=labelBean.getLabel("THE_ASTERISK")%></li> </ul> </td> </tr> </table> <jsp:include page="/Footer.jsp" /> </form> </body> </html> This is error for the first page.. This is picture that which i wan.. Thanks! I have a basic function: function Notice() { var selectedCountry = CheckoutForm.elements["shipping-country"].selectedIndex; if (selectedCountry != 'United States') { alert('You are outside the US'); } } I have a select control with id "shipping-country": <select name="shippingCountry" id="shipping-country" > <option value="AF">Afghanistan</option> <option value="AL">Albania</option> ... </select> How can I trigger my function on selection change if I don't have access to html code or the server side code that generated the select control? typically I would just add onchange="Notice();" , but this option is out of the out of the question for the above reason. Any help would be appreciated. Hi guys, first of all im sorry cause i dont know the javascript name and what should this call. i wanted to make a Helps and Guides look like this website http://fnatic.com/ Feedback that located on the left side. If can totally make like them then i hope the script can open a new window with custom size and address bar. I hope someone can help me... i will change my topic tittle if i know what is this call. sorry im a pure newbie in web programming. hopes you all can help me. thanks alot. |