JavaScript - Need Help With Easyslider Lytebox Combo
On a friend's site I am using a combination of easyslider (a slideshow script) and lytebox (probably doesn't need an intro). It can be seen in action on http://www.maisonportier.com/menu.php (then click on 'Press'). I really don't know much about Javascript so am just able to do extremely simple things such as combining two script. Now my friend want the slideshow to pause when an image is opened (using Lytebox), and to continue when the image is closed. The scripts can be found at:
http://www.maisonportier.com/js/lytebox.js and http://www.maisonportier.comeasySlider1.5.js Can anybody tell me how to modify the code? Any help is greatly appreciated! Similar TutorialsHello I'm using the combo box selection menu by Elviro Mirko from this site (http://www.javascriptkit.com/script/...plecombo.shtml) I have made amendments to show my own data, however what I would like to happen is if the user selects from the top combo only, then all the records would be shown, whereas selecting from the second combo merely 'drills down' and shows the records required. - Hope that makes sense. The code is as follows: Code: // first combo box data_1 = new Option("Douglas - DIS", "$"); data_2 = new Option("Douglas - COE", "$$"); data_3 = new Option("Peel - DIS", "$$$"); data_4 = new Option("Peel - COE", "$$$$"); data_5 = new Option("Ramsey - DIS", "$$$$$"); data_6 = new Option("Ramsey - COE", "$$$$$$"); data_7 = new Option("Castletown - DIS", "$$$$$$$"); data_8 = new Option("Castletown - COE", "$$$$$$$$"); // second combo box data_1_1 = new Option("Registry Office Douglas", "-"); data_1_2 = new Option("Broadway Baptist Church Douglas", "-"); data_1_3 = new Option("Finch Hill Congregational Church Douglas", "-"); data_2_1 = new Option("St Thomas's Church", "--"); data_2_2 = new Option("St Barnabas Church", "--"); data_2_3 = new Option("St George's Church", "--"); The HTML code is as follows: Code: <select name="combo0" id="combo_0" onChange="change(this);" style="width:200px;"> <option value="">Select a Register...</option> <option value="Douglas - DIS">Douglas - DIS</option> <option value="Douglas - COE">Douglas - COE</option> <option value="Peel - DIS">Peel - DIS</option> <option value="Peel - COE">Peel - COE</option> <option value="Ramsey - DIS">Ramsey - DIS</option> <option value="Ramsey - COE">Ramsey - COE</option> <option value="Castletown - DIS">Castletown - DIS</option> <option value="Castletown - COE">Castletown - COE</option> </select> <BR><BR> <select name="combo1" id="combo_1" onChange="change(this)" style="width:200px;"> <option value="">Select a venue...</option> </select> the link for the actual site is http://www.manxbmd.com/cgi-bin/db.cg...m;db=marriages If you choose Douglas-COE and search, then 0 records are found, if you choose Douglas-COE followed by St Thomas's then still 0 records are found but if you search the surname Allitson you'll see that there is a record there. I'm not sure where I've gone wrong - I'm completely new to Javascript. Any suggestions welcomed. regards Pendle Hi Everybody This is probably a very commonly asked question, however after much searching online I can't seem to find a straightforward answer. If anyone knows the code or a link to a place with a simple example it would be great. What I have got is a form that a user has to fill out and submit (when validated all variables are stored in a session and emailed after multiple forms are completed), currently I have radio buttons, text boxes and a combo box/ drop down list (for location). All parts are working fine and validating fine. My problem is to do with the combo box//ddl. I have successfully validated the ddl so the user must select a location onsubmit and it is added to session and passed fine. At the moment the ddl only has cities or towns in it however as I would like to include different states and possibly different countries I need a code that validates the state first and then only gives the cities/towns that are in that state (otherwise my ddl would be to large). I can do this with links however I can't seem to do it in a form. I am trying to do it this way DDL has list of all states that on mouseover/ onclick the list is revealed. onclick of a specific state populates another ddl with only the cities cities/ towns that are in that state and onclick of specific city selects the location whereby onsubmit the location is stored in the the session for submission by email Thanks in advance for your help I still have the following two major issues. 1) Firstly I need to be able to send the selection from the second combo box by php. 2) secondly I need the combo box to appear within the table. (I thought this should be easy, but for the life of me cannot figure out how to get the dynamic combo into my table inside the form) I have managed to send the selection from the first combo box with the form and also I can send a selection from the second combo, however onsubmit regardless of what is selected in the second combo box it simply sends the last option not the one selected. I have spent many hours trying to figure out why this is the case to no avail. I have included my code for anyone who may be able to help. Lastly when I have figured out these 2 (with a little help) I should be able to sort out the validation by myself. Please ignore any code that is not relevant <html> <head> <script type="text/javascript"> var this1; window.onload = function() { if (!document.all) document.captureEvents(Event.CHANGE); document.getElementById('myddl').onchange = readDDL1; } function readDDL1() { var ddlobj = document.getElementById('myddl'); var currentSelection = ddlobj.options[ddlobj.options.selectedIndex].value; if (currentSelection == '') currentSelection = ddlobj.options[ddlobj.options.selectedIndex].text; doDDL2(currentSelection); } function doDDL2(ddl1Selection) { var existingDDL2; if ((existingDDL2 = document.getElementById('myddl2')) != null) existingDDL2.parentNode.removeChild(existingDDL2); var ddl2Options; switch (ddl1Selection) { case "Western Australia": ddl2Options = ["Please Select A Location", "Karratha", "Perth"]; break; case "Queensland": ddl2Options = ["Please Select A Location", "Brisbane", "Gold Coast"]; break; } if (typeof ddl2Options == "object") { ddl2 = document.createElement('select'); ddl2.id = "myddl2"; var forVar; for (forVar in ddl2Options) { var newOption = document.createElement('option'); newOption.appendChild(document.createTextNode(ddl2Options[forVar])); ddl2.appendChild(newOption); } document.body.appendChild(ddl2); } document.testform.this1.value = ((ddl2Options[forVar])); } function checkFrequency() { return ShowResults(); } function validate(){ var digits="0123456789" var temp if (document.testform.location.selectedIndex == 0) { alert("Please Select a State"); return false } if (document.testform.location2.selectedIndex == 0) { alert("Please Select a Location"); return false } return true } </script> <style type="text/css"> .td_freq { background-color:yellow; height:40px; text-align:center; } .td_sev { background-colorink; height:40px; text-align:center; } .td_wi { background-color:lightgreen; height:40px; text-align:center; } </style> </head> <body> <FORM name="testform" action='./emlapd.php' method='post' onsubmit="return checkFrequency()"> <input type='hidden' name='this1'> <table align="center" border="1" width="40%"> <tr><td><b>Current Worksite State:</b><font color="red">*</font></td> <td> <select name="location" width='53' id="myddl"> <option value="0">--- Please Select Your State --- & nbs p; & n bsp; & nbs p; </option> <option value="Western Australia">Western Australia</option> <option value="Queensland">Queensland</option> </select> </td></tr> <tr><td><b>Location:</b><font color="red">*</font></td> <td> </td></tr> </table> <tr> <th colspan="2"> <input type="submit" name='submit' value="Submit" onclick= "return validate()"> </th> <td colspan="10"> </td> <th> <input type='reset' name='reset' value='Clear Form'> </th> </tr> </table> </FORM> </body> </html> Thankyou very much to everyone that may help So I can place the DDL inside the form, however it places it at the end of the form. I want it somewhere in the middle (immediately following first combo box) My other main issue is irregardless of the selection it simply posts the last option from the DDL not the one selected. Therefore I still want the second combo box to appear immediately below the first combo box and whatever option is selected from the second combo box I want to be posted with the rest of the form data. If you have any other ideas that would be great Obviously the reason I am still getting the same incorrect post is because the variable posted is still this1 from my code which reads the last value from the DDL. I have tried with all other variables to send as well ie ddl2 however still can't seem to send the selection. So in its current state how can I send the selection and place the second DDL within the form?? Thank you Hi all hope i can get a response - would like to be able to make my thumbnails link to the correct image inside easyslider so when the link is clicked the images jumps to the correct slide please look at the website to get what i mean - at the moment all links just go to the first slide, any help would be really appreciated www.seunshotephotography.com have no clue how to do this and getting really frustrated hello coding forums friends please help me i got stuck in sliding a slider that from easyslider. everything is ok when i individually browse from folder see here http://www.sajeebgroup.com/robin/easyslider/slider.php but when i tried to include in a divition in index.php page it do not slide but only one image is show see here right side news update div link is http://www.sajeebgroup.com/ what problem please help me i really going to frustrated to solve this. here is my index.php code with include of easy slide. index.php PHP Code: <?php include 'news/common/connection.php'; ?> <html> <head> <title>Welcome to Sajeeb Group</title> <style> .black_overlay{ display: none; position: absolute; top: 0%; left: 0%; width: 100%; height: 150%; background-color: #000000; z-index:1001; -moz-opacity: 0.8; opacity:.80; filter: alpha(opacity=80); } .white_content { display: none; position: absolute; top: 55%; left: 23%; width: 50%; height: 50%; padding: 16px; border: 16px solid orange; background-color: white; z-index:1002; overflow: auto; } </style> <script type="text/javascript" src="swfobject.js"></script> <script type="text/javascript" src="swfobject.js"></script> <style type="text/css"> #ticker-container { position:relative; overflow:hidden; width: 170px; height: 200px; padding-top:10px; color:#000000; margin-top:8px; } #ticker { position:relative; width:150px; } </style> <script language="JavaScript"> function openit(link) { var url="./news/newsinfo.php?id="+link; window.open(url,"mywindow","resizable=0,scrollbars=1,height=400,width=400"); } //scroller width var swidth=170; //scroller height var sheight=205; //background color var sbcolor='#ccffff'; //scroller's speed var sspeed=3; var msg='' <?php $str="SELECT * from newsscroll ORDER BY news_id desc"; $res=mysql_query($str) or die("Error in selecting....."); while($dataNews=mysql_fetch_row($res)) { do{ echo "msg+=\"<ul><li><a href=# onclick=openit(\'".$dataNews[0]."\')><font size=2>".$dataNews[1]."</font></a></li><br></ul>\";"; }while($dataNews=mysql_fetch_row($res)); } ?> //End of your messages // Begin the ticker code var resumesspeed=sspeed function start() { if (document.all) iemarquee(ticker); else if (document.getElementById) ns6marquee(document.getElementById('ticker')); } function iemarquee(whichdiv){ iediv=eval(whichdiv) sheight += 50; iediv.style.pixelTop=sheight iediv.innerHTML=msg sizeup=iediv.offsetHeight ieslide() } function ieslide(){ if (iediv.style.pixelTop>=sizeup*(-1)){ iediv.style.pixelTop-=sspeed setTimeout("ieslide()",100) } else{ iediv.style.pixelTop=sheight ieslide() } } function ns6marquee(whichdiv){ ns6div=eval(whichdiv) sheight += 50; ns6div.style.top=sheight + "px"; ns6div.innerHTML=msg sizeup=ns6div.offsetHeight ns6slide() } function ns6slide(){ if (parseInt(ns6div.style.top)>=sizeup*(-1)){ theTop = parseInt(ns6div.style.top)-sspeed ns6div.style.top = theTop + "px"; setTimeout("ns6slide()",100) } else { ns6div.style.top = sheight + "px"; ns6slide() } } </script> <script type="text/javascript" src="swfobject.js"></script> <script language="JavaScript" type="text/JavaScript"> <!-- function MM_findObj(n, d) { //v4.01 var p,i,x; if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) { d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);} if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n]; for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document); if(!x && d.getElementById) x=d.getElementById(n); return x; } function MM_preloadImages() { //v3.0 var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array(); var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++) if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}} } function MM_swapImgRestore() { //v3.0 var i,x,a=document.MM_sr; for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) x.src=x.oSrc; } function MM_swapImage() { //v3.0 var i,j=0,x,a=MM_swapImage.arguments; document.MM_sr=new Array; for(i=0;i<(a.length-2);i+=3) if ((x=MM_findObj(a[i]))!=null){document.MM_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];} } //--> </script> <style type="text/css"> <!-- .gallery { zoom:1; width:520px; } --> </style> <script type="text/javascript">var LightBoxOpt={autoPlay:false}</script> <link rel="stylesheet" href="engine/css/lightbox.css" type="text/css" media="screen" /> <script src="engine/js/prototype.js" type="text/javascript"></script> <script src="engine/js/scriptaculous.js?load=effects,builder" type="text/javascript"></script> <script src="engine/js/lightbox.js" type="text/javascript"></script> <style> .gallery { zoom:1; width:700px; } .gallery a { display: block ; float:center; margin:5px; padding:5px; height: 150px; border:solid 1px #b8b8b8; background-color:#FFFFFF; opacity:0.87; alignment: center; } .gallery a:hover { opacity:1; } .gallery a img { border:none; display:block; } .gallery a#vlightbox{display:none} .gallery1 { zoom:1; width:520px; } .gallery2 { zoom:1; width:520px; } .gallery3 { zoom:1; width:520px; } .gallery4 { zoom:1; width:520px; } .gallery5 { zoom:1; width:520px; } .gallery6 { zoom:1; width:520px; } .gallery7 { zoom:1; width:520px; } .gallery8 { zoom:1; width:520px; } .gallery9 { zoom:1; width:520px; } .gallery10 { zoom:1; width:520px; text-align:center; } .style1 {font-family: Arial, Helvetica, sans-serif} .style3 {font-size: 12px} .gallery11 { zoom:1; width:520px; } .gallery12 { zoom:1; width:520px; } .gallery13 { zoom:1; width:520px; } .gallery14 { zoom:1; width:520px; } .gallery15 {zoom:1; width:520px; } .gallery15 { zoom:1; width:700px; } .gallery111 {zoom:1; } .gallery121 {zoom:1; } .gallery131 {zoom:1; } .gallery1111 {zoom:1; } .gallery1311 {zoom:1; } .gallery13111 {zoom:1; } #link_style { text-decoration:none; color:#000000;} </style> </head> <body background="images/wr_body.gif" 'images/btn%20import%20over.gif','images/btn%20contact%20over.gif','images/btn%20home%20over.gif','images/btn%20link4%20over.gif')"> <div align="center"> <table cellpadding="0" cellspacing="0" width="775" height="107"> <!-- MSTableType="layout" --> <tr> <td valign="top" width="258"> <img border="0" src="images/head logo.gif" width="258" height="107"></td> <td valign="top" height="107" width="517"> <img border="0" src="images/head right.gif" width="517" height="107"></td> </tr> </table> </div> <div align="center"> <table cellpadding="0" cellspacing="0" width="775" height="798"> <!-- MSTableType="layout" --> <tr> <td width="775" height="798" valign="top"> <div id="FlashMenuLabs"> You need to upgrade your Flash Player or to allow javascript to enable Website menu.</br> <a href="http://www.adobe.com/go/getflashplayer">Get Flash Player</a> </div> <script type="text/javascript"> // <![CDATA[ var so = new SWFObject("menu.swf", "menu", "774", "35", "8", "#000000"); so.addParam("wmode", "transparent"); so.addParam("scale", "noscale"); so.addParam("salign", "TL"); so.write("FlashMenuLabs"); // ]]> </script> <table cellpadding="0" cellspacing="0" width="775" height="223"> <!-- MSTableType="layout" --> <tr> <td width="775" height="223" valign="top"> <object classid="clsid:D27CDB6E-AE6D-11CF-96B8-444553540000" id="obj1" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,40,0" border="0" width="774" height="223"> <param name="movie" value="body anim.swf"> <param name="quality" value="High"> <embed src="body%20anim.swf" pluginspage="http://www.macromedia.com/go/getflashplayer" type="application/x-shockwave-flash" name="obj1" width="774" height="223"></object> </td> </tr> </table> <table cellpadding="0" cellspacing="0" width="775" height="232" id="table1"> <!-- MSTableType="layout" --> <tr> <td valign="bottom" background="images/welcome%20bg.gif"> <div align="right"> <table cellpadding="0" cellspacing="0" width="370" height="180"> <!-- MSTableType="layout" --> <tr> <td background="images/welcome%20text%20bg.gif" height="180" width="370"> <div align="center"> <table cellpadding="0" cellspacing="0" width="346" height="159"> <!-- MSTableType="layout" --> <tr> <td width="346" height="159" valign="top" style="text-align:justify;"> <font face="Verdana" size="2" color="#203E59"> </font></td> </tr> </table> </div> </td> </tr> </table> </div> </td> <td></td> <td valign="top" height="230" background="images/news%20bg.gif"> <body onload="start();"> <div id="ticker-container" onmouseover="sspeed=0;" onmouseout="sspeed=resumesspeed"> [COLOR="Red"]here i want to include slide <div id="ticker"> <?php include("robin/easyslider/slider.php"); ?> </div> </div>[/COLOR] </div> </div> </td> </tr> <tr> <td width="563"></td> <td width="3"></td> <td height="2" width="209"></td> </tr> </table> </div> <div align="center"> <table cellpadding="0" cellspacing="0" width="775" height="230" id="table2"> <!-- MSTableType="layout" --> <tr> <td valign="top" background="images/divisions-bg.gif" rowspan="2" width="563"> <div align="center"> <table cellpadding="0" cellspacing="0" width="549" height="169" style="text-align:left;"> <!-- MSTableType="layout" --> <tr > <td valign="top" height="32" colspan="2"> <p style="margin-left: 10px; margin-top: 10px"><b> <font size="2" face="Verdana" color="#203E59">Group Capability</font></b></td> </tr> <tr> <td height="137" width="279" valign="top"> <ul> <li> <p style="margin-top: 6px; margin-bottom: 3px"> <font face="Verdana" size="2" color="#203E59"> <span class="gallery1111"><a href="homepage/sajeeb-group.jpg" rel="lightbox[sample]" style="text-decoration:none; color:#203E59;">Sajeeb Corporation</a></span></font> </li> <li> <p style="margin-top: 6px; margin-bottom: 3px"> <font face="Verdana" size="2" color="#203E59"> <span class="gallery1111"><a href="homepage/sajib-agro.jpg" rel="lightbox[sample]" style="text-decoration:none; color:#203E59;" >Sajeeb Agro Limited</a></span></font> </li> <li> <p style="margin-top: 6px; margin-bottom: 3px"> <font face="Verdana" size="2" color="#203E59"> <a href="http://www.ststelecomltd.com/" style="text-decoration: none"> <font color="#203E59">STS Telecom Limited</font></a></font></li> <li> <p style="margin-top: 6px; margin-bottom: 3px"> <font face="Verdana" size="2" color="#203E59"> <span class="gallery1111"><a href="homepage/hashem-auto.jpg" rel="lightbox[sample]" style="text-decoration:none; color:#203E59;">Hashem Auto Rice Mill</a></span></font></li> <li> <p style="margin-top: 6px; margin-bottom: 3px"> <font face="Verdana" size="2" color="#203E59"> <span class="gallery1111"><a href="homepage/chittagong-enamel.jpg" rel="lightbox[sample]" style="text-decoration:none; color:#203E59;">Chittagong Enamel & Aluminium Works Ltd.</a></span></font></li> <li> <p style="margin-top: 6px; margin-bottom: 3px"> <font face="Verdana" size="2" color="#203E59"> <span class="gallery1111"><a href="homepage/sajeeb-industries.jpg" rel="lightbox[sample]" style="text-decoration:none; color:#203E59;">Sajeeb Industrial Corporation</a></span></font></li> </ul> </td> <td height="137" width="270" valign="top"> <ul> <li> <p style="margin-top: 6px; margin-bottom: 2px"> <font size="2" face="Verdana" color="#203E59"> <span class="gallery1111"><a href="homepage/Hasem-foods.jpg" rel="lightbox[sample]" style="text-decoration:none; color:#203E59;">Hashem Foods Limited</a></span></font></li> <li> <p style="margin-top: 6px; margin-bottom: 2px"> <font size="2" face="Verdana" color="#203E59"> <span class="gallery1111"><a href="homepage/sajib-home.jpg" rel="lightbox[sample]" style="text-decoration:none; color:#203E59;">Sajeeb Homes Limited</a></span></font></li> <li> <p style="margin-top: 6px; margin-bottom: 2px"> <font size="2" face="Verdana" color="#203E59"> <span class="gallery1111"><a href="homepage/mermaid.jpg" rel="lightbox[sample]" style="text-decoration:none; color:#203E59;">Mermaid Sweater Ltd.</a></span></font></li> <li> <p style="margin-top: 6px; margin-bottom: 2px"> <font size="2" face="Verdana" color="#203E59"> <a href="http://www.takaful.com.bd/" style="text-decoration: none"> <font color="#203E59">Takaful Islami Insurance Limited </font></a></font></li> <li> <p style="margin-top: 6px; margin-bottom: 2px"> <font size="2" face="Verdana" color="#203E59"><a href="http://www.ststelecomltd.com/" style="text-decoration: none" target="_self"><font color="#203E59">STS Telecommunications (M) Sdn Bhd</font></a></font></li> <li> <p style="margin-top: 6px; margin-bottom: 2px"> <font size="2" face="Verdana" color="#203E59"><a href="http://www.ststelecomltd.com/" style="text-decoration: none" target="_self"><font color="#203E59"> Meghna Insurance Company Ltd. </font></a></font></li> </ul> </td> </tr> </table> </div> </td> <td></td> <td valign="middle" height="115" background="images/message%20bg.gif"> <div align="right"> <table cellpadding="0" cellspacing="0" width="180" height="99"> <!-- MSTableType="layout" --> <tr> <td width="180" height="99" valign="middle"> <p align="justify" style="margin-left: 5px; margin-right: 8px"> <font size="1" face="Verdana" color="#203E59">Welcome you all in the world of �Sajeeb group of Companies� to get the taste of modernization and continuous improvement in the business arena of Bangladesh. (<a href="message.php"><font color="#224562">Read More>></font></a>)</font></td> </tr> </table> </div> </td> </tr> <tr> <td width="3"> <p style="margin-top: 2px; margin-bottom: 2px"></td> <td valign="bottom" height="115" background="images/webmail%20bg.gif" width="209"> <div align="right"> <table cellpadding="0" cellspacing="0" width="180" height="100"> <!-- MSTableType="layout" --> <tr> <td width="180" height="100" valign="middle"> <form method="POST" action="http://sajeebgroup.com:2096/login/" style="text-align:right; padding-right:4px;"> <!--webbot bot="SaveResults" U-File="fpweb:///_private/form_results.csv" S-Format="TEXT/CSV" S-Label-Fields="TRUE" --> <p style="margin-left: 5px; margin-right: 3px; margin-top: 2px; margin-bottom: 2px"> <b><font face="Verdana" size="1" color="#203E59"> Email : </font></b> <font color="#203E59"> <input name="user" type="text" id="user" size="12"> </font></p> <p style="margin-left: 5px; margin-right: 3px; margin-top: 2px; margin-bottom: 2px"> <b><font face="Verdana" size="1"> <font color="#203E59">Password:</font> </font></b> <input name="pass" type="password" id="pass" size="12"> <input type="submit" value="Login" name="B1" style="margin-top:2px;"> </p> </form> </td> </tr> </table> </div> </td> </tr> </table> </div> <table cellpadding="0" cellspacing="0" width="775" height="90"> <!-- MSTableType="layout" --> <tr> <td width="775" height="90" valign="middle"> <table cellpadding="0" cellspacing="0" width="775" height="79"> <!-- MSTableType="layout" --> <tr> <td background="images/bottom%20bg%20home.gif" valign="bottom" height="79" width="775"> <table cel I'm working on a website for a freelance writer. I've used a lytebox mod to open a modal dialogue box that shows a scan of each magazine article. The code allows for an "info" button at the bottom of the window, which when clicked calls a page info.php, and populates that page with text from an [info] variable on the main page. My question is this. I'd like to use the "info" button to call entire articles in text format from a separate php page. I don't want to insert these long articles into the main page. Is there an easy way to do this in the code? The info.php page code follows: <div class="info"><?php if (isset($_GET['info'])){ $text = $_GET['info']; $text = str_replace('<br/>',"\n",$text); } else { $text = 'This page is showing text from GET "info" variable'; } echo $text; ?></div> The entire info.php page is he http://www.mimiread.com/info.php The main lytebox.js page that I'm using is he http://www.mimiread.com/lytebox.js The code line that calls this from the main page: <a href="images/ttlnob-cover.jpg" rel="lytebox[essays-ttlnob]" rev="[info]ttlnob.html[/info]" title=""><img src="images/essays-ttlnob.jpg" border="0" alt="house beautiful, the trying to leave new orleans blues" /></a> Any help would be appreciated. Hi all, I have created the following page http://www.kylehouston.com/testing/cci/ When loading in ie6 and ie7 the content slider exposes all the slides until fully loaded, is it possible to hide these slides while loading? Thanks in advance Kyle Hello, I am very new to HTML and PHP but have managed to create a drop down "Surname" box on my website to list all the current surnames in my mySQL database. However, I also want the user to be able to type into the box and for the drop down list to automatically filter depending on the text the user inserts. I understand that this is not possible in HTML and PHP and requires some JavaScript, however I have never used this before and have no idea where to start. Any suggestions or help will be much appreciated. Here is my current HTML and PHP code... Code: $sql="SELECT Surname FROM Patients"; $result=mysql_query($sql); ?> <form name="form" method="POST" action="<?php echo $_SERVER['PHP_SELF'];?>"> Surname: <?php echo "<select name=\"surname\">"; echo "<option size =30 ></option>"; while($row = mysql_fetch_array($result)) { echo "<option value='".$row['Surname']."'>".$row['Surname']."</option>"; } echo "</select>"; ?> Thank you! I have 2 combo boxes where you can move the items in combo box 1 to combo box 2. I want to validate that combo box 2 actually has something moved to it. How can I count the items in combo box 2. Combo box 2 will initially have no items in the box on page load. It is up to the user to move the items to combo box 2 and I want to make sure at least 1 item was moved.
Hi I am doing a java program. In which I have a jsp page, and on that I have two combobox. I have a create a java bean, in which I am extracting the database. I want to populate the combobox by extracting data from database. can anyone suggest me some code using java script , which i can use to populate my combobox. Thanks in advance Hi all, I have a problem here with my coding. I want to have three levels combo box. However the second level is not populating the values, therefore the third level cannot be populated also. I have attcached my codes here. Pls have a look and tell me where is my error. Thanks, Breentha i'm desperately seeking some javascript advice. I'm currently using wysiwyg webbuilder 8. I have one of my combo boxes linking to another but i want the first box to affect text on the page the text id is text23 and here is the coding i am using at the moment Code: <script type="text/javascript"> function fillSecondCombo() { var combo1 = document.getElementById('Combobox3'); var combo2 = document.getElementById('Combobox4'); var selected = combo1.options[combo1.options.selectedIndex].value; if (selected == 1) { combo2.options.length = 1; combo2.options[0] = new Option("999 Million Forza 3 Credits", "1"); } else if (selected == 2) { combo2.options.length = 5; combo2.options[0] = new Option("999 Million Forza 4 Credits", "1"); combo2.options[1] = new Option("750 Million Forza 4 Credits", "2"); combo2.options[2] = new Option("500 Million Forza 4 Credits", "3"); combo2.options[3] = new Option("400 Million Forza 4 Credits", "4"); combo2.options[4] = new Option("300 Million Forza 4 Credits", "5"); combo2.options[5] = new Option("200 Million Forza 4 Credits", "6"); combo2.options[6] = new Option("100 Million Forza 4 Credits", "7"); combo2.options[7] = new Option("75 Million Forza 4 Credits", "8"); } else if (selected == 3) { combo2.options.length = 4; combo2.options[0] = new Option("2k Gamerscore Increase", "7"); combo2.options[1] = new Option("5k Gamerscore Increase", "8"); combo2.options[2] = new Option("10k Gamerscore Increase", "9"); combo2.options[3] = new Option("25k Gamerscore Increase", "10"); } else if (selected == 4) { combo2.options.length = 4; combo2.options[0] = new Option("1 Purchased", "7"); combo2.options[1] = new Option("2 Purchased", "8"); combo2.options[2] = new Option("3 Purchased", "9"); combo2.options[3] = new Option("4 Purchased", "10"); } else if (selected == 5) { combo2.options.length = 4; combo2.options[0] = new Option("1 Purchased", "7"); combo2.options[1] = new Option("2 Purchased", "8"); combo2.options[2] = new Option("3 Purchased", "9"); combo2.options[3] = new Option("4 Purchased", "10"); } else if (selected == 6) { combo2.options.length = 4; combo2.options[0] = new Option("1 Purchased", "7"); combo2.options[1] = new Option("2 Purchased", "8"); combo2.options[2] = new Option("3 Purchased", "9"); combo2.options[3] = new Option("4 Purchased", "10"); } else { combo2.options.length = 0; } } </script> this is the only thing i need to complete the site i am working on hi again i have form with name age payment mode ( combo boxe include payment mode 1,payment mode 2 , payment mode 3) when i select a payment mode-01 enabbleling 5 combo boxes if slect payment mode 2 dissabling that combo boxes... how do i do this thing plzz give me sample code...................... i wud like to grab the values for the selected item in the last combobox n insert it into a form. thanks in advance Code: <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <title>Untitled Document</title> <script type="text/javascript"> // first combo box data_1 = new Option("1", "$"); data_2 = new Option("2", "$$"); // second combo box data_1_1 = new Option("11", "-"); data_1_2 = new Option("12", "-"); data_2_1 = new Option("21", "--"); data_2_2 = new Option("22", "--"); data_2_3 = new Option("23", "--"); data_2_4 = new Option("24", "--"); data_2_5 = new Option("25", "--"); // third combo box data_1_1_1 = new Option("111", "1"); data_1_1_2 = new Option("112", "2"); data_1_1_3 = new Option("113", "3"); data_1_2_1 = new Option("121", "4"); data_1_2_2 = new Option("122", "5"); data_1_2_3 = new Option("123", "6"); data_1_2_4 = new Option("124", "7"); data_2_1_1 = new Option("211", "8"); data_2_1_2 = new Option("212", "9"); data_2_2_1 = new Option("221", "10"); data_2_2_2 = new Option("222", "11"); data_2_3_1 = new Option("231", "12"); data_2_3_2 = new Option("232", "13"); // other parameters displaywhenempty="" valuewhenempty=-1 displaywhennotempty="-select-" valuewhennotempty=0 function change(currentbox) { numb = currentbox.id.split("_"); currentbox = numb[1]; i=parseInt(currentbox)+1 // I empty all combo boxes following the current one while ((eval("typeof(document.getElementById(\"combo_"+i+"\"))!='undefined'")) && (document.getElementById("combo_"+i)!=null)) { son = document.getElementById("combo_"+i); // I empty all options except the first one (it isn't allowed) for (m=son.options.length-1;m>0;m--) son.options[m]=null; // I reset the first option son.options[0]=new Option(displaywhenempty,valuewhenempty) i=i+1 } // now I create the string with the "base" name ("stringa"), ie. "data_1_0" // to which I'll add _0,_1,_2,_3 etc to obtain the name of the combo box to fill stringa='data' i=0 while ((eval("typeof(document.getElementById(\"combo_"+i+"\"))!='undefined'")) && (document.getElementById("combo_"+i)!=null)) { eval("stringa=stringa+'_'+document.getElementById(\"combo_"+i+"\").selectedIndex") if (i==currentbox) break; i=i+1 } // filling the "son" combo (if exists) following=parseInt(currentbox)+1 if ((eval("typeof(document.getElementById(\"combo_"+following+"\"))!='undefined'")) && (document.getElementById("combo_"+following)!=null)) { son = document.getElementById("combo_"+following); stringa=stringa+"_" i=0 while ((eval("typeof("+stringa+i+")!='undefined'")) || (i==0)) { // if there are no options, I empty the first option of the "son" combo // otherwise I put "-select-" in it if ((i==0) && eval("typeof("+stringa+"0)=='undefined'")) if (eval("typeof("+stringa+"1)=='undefined'")) eval("son.options[0]=new Option(displaywhenempty,valuewhenempty)") else eval("son.options[0]=new Option(displaywhennotempty,valuewhennotempty)") else eval("son.options["+i+"]=new Option("+stringa+i+".text,"+stringa+i+".value)") i=i+1 } //son.focus() i=1 combostatus='' cstatus=stringa.split("_") while (cstatus[i]!=null) { combostatus=combostatus+cstatus[i] i=i+1 } return combostatus; } } //--> </script> </head> <body> <form> <select name="combo0" id="combo_0" onChange="change(this);" style="width:200px;"> <option value="value1">-select-</option> <option value="value2">1</option> <option value="value3">2</option> </select> <BR><BR> <select name="combo1" id="combo_1" onChange="change(this)" style="width:200px;"> <option value="value1"> </option> </select> <BR><BR> <select name="combo2" id="combo_2" onChange="change(this);" style="width:200px;"> <option value="value1"> </option> </select> <BR><BR> </form> </body> </html> hiii friends hw r u ??? m sachin nd currently i m a student of s\w engg. i had gone through a code which i founded on " javascriptkit.com" nd make some change according to my requirements and that code is as follows : - Code: <%@page contentType="text/html"%> <%@page pageEncoding="UTF-8"%> <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> <html> <head> <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"> <title>JSP Page</title> </head> <body> <h1>Ticket Booking Page</h1> <form name="doublecombo"> <p><select name="example" size="1" onChange="redirect(this.options.selectedIndex)"> <option>Select City</option> <option>New Delhi</option> <option>Mumbai</option> <option>Kolkata</option> <option>Chennai</option> </select> <select name="stage2" size="1" onChange="redirect1(this.options.selectedIndex)"> <option value="Select">Select Cinema</option> </select> <script> <!-- /* Double Combo Script Credit By JavaScript Kit (www.javascriptkit.com) Over 200+ free JavaScripts here! */ /* this is d start of code is for selecting cinemas by selecting value of city from 1st combo box */ var groups=document.doublecombo.example.options.length var group=new Array(groups) for (i=0; i<groups; i++) group[i]=new Array() group[0][0]=new Option("Select Cinema") group[1][0]=new Option("Select Cinema") group[1][1]=new Option("HauzKhas") group[1][2]=new Option("Saket","Saket") group[2][0]=new Option("Select Cinema") group[2][1]=new Option("NaviMumbai") group[2][2]=new Option("Churchgate") group[3][0]=new Option("Select Cinema") group[3][1]=new Option("Saltlake") group[3][2]=new Option("Badabazar") group[4][0]=new Option("Select Cinema") group[4][1]=new Option("krishnapuram") group[4][2]=new Option("old market") var temp=document.doublecombo.stage2 function redirect(x){ for (m=temp.options.length-1;m>0;m--) temp.options[m]=null for (i=0;i<group[x].length;i++){ temp.options[i]=new Option(group[x][i].text,group[x][i].value) } temp.options[0].selected=true } /* this is d end of code is for selecting cinemas by selecting value of city from 1st combo box */ //--> </script> </form> </body> </html> After this code i want to populate values 3rd combo box by selecting values in the 2nd combo box ( which is cinema ) bt after applying all the posible option to solve this problm nd i m nt getting success ,so m writing to you people for ur help. i will explain u the whole matter thn u wil better understand my problm. i m making one website on multiplex( online ticket booking). so i saw the website of pvr cinemas nd i thought i wil impliment this ticket booking concept in my project, so for the fullfillness of this target i hav to take atleast 7 combo box , these combo box names are :- 1. Select City- (Like - New Delhi , Mumbai ,Kolkata ,Chennai) 2. Select Cinema(Hall Name) - ( Saket - New Delhi , South Ex. - New Delhi, Navi Mumbai - Mumbai , Salt Lake - Kolkata) 3. Select Movie- (Atleast 3 movies in each cinema nd somtimes it can more or less hall by hall ) 4.Select Date - (next 5 days of current date for advanced booking) 5. Select Time - (show time for each movie in each hall should be 3 shows, means if 3 movies are playing currently in 1 cinema thn we hav to mention show times with some difference for all 3 movies. ) 6.Select Price - ( price can b d same for all movies like - 150 (normal),250 (middle ) , 500 (high) ) 7. Select No. of Seats - ( no of seats for advanced booking is 1 to 10 for every film). your given link solved my 1st combo box problm dear bt nw facing another problm. i want to populate all the movies in 3rd combo box by selecting a cinema value in 2nd combo box . for example i selected " saket - new delhi " thn all the movies which r playing currently in this cinema should be comes in d 3rd com bo box . same as for other options south ex. - new delhi , navi mumbai - mumbai nd so on. i think this problm can be solved by three dimensional or multi dimensional arrays bt friends i dont hav much knowledge of multi dimensional arrays in javascript. if u people will help me to solve this problm thn i will be very thank full to all of you. i hav less time friends. so will u plz help me ??????? please reply me soon friends............ thank you I have been working with the double combo box w/ description script from javascriptkit, and I attempted to add an additional 3rd combo box that would switch selects based upon selection of the 2nd combo box, but I am having difficulty with this. Any help would be appreciated. Here is the code: Code: <script language="JavaScript"> <!-- //Double Combo Box with Description Code- by Randall Wald (http://www.rwald.com) //Visit JavaScript Kit (http://javascriptkit.com) for script //Credit must stay intact for use var num_of_cats = 4; // This is the number of categories, including the first, blank, category. var open_in_newwindow=1; //Set 1 to open links in new window, 0 for no. var option_array = new Array(num_of_cats); option_array[0] = new Array("You need to select a category"); // This is the first (blank) category. Don't mess with it. option_array[1] = new Array("-- Select One --", "JavaScript Kit", "News.com", "Wired"); option_array[2] = new Array("-- Select One --", "CNN", "ABC News"); option_array[3] = new Array("-- Select One --", "Google", "Ask Jeeves"); var text_array = new Array(num_of_cats); text_array[0] = new Array("Here's how you use this box: First, you select a category in the Category drop-down. Then, select a link from the Link drop-down. Then, read the description in this box, or click Go to go to the page. If you ever need to see this help again, just go back to the top option in the Category box."); // These are general instructions. Change them if you want, or keep them if you don't. text_array[1] = new Array("These are some of my favorite technology sites. You should visit them.", // Note that the first entry here is a general description of this category. After than, they're descriptions of each link. Make sure that you don't put the first link first; the general description must be first. "This is a page with a bunch of nice JavaScripts that you can use. They also have tutorials in all sorts of subjects.", "CNet news. If it's in technology, it's in here.", "Wired magazine is the type of magazine which needs no introduction."); text_array[2] = new Array("These days, it's important to keep up on the news. These sites will help you do that.", "CNN. What list of news sites would be complete without it?", "Here, you can get links to World News Tonight, or see video clips."); text_array[3] = new Array("If you can't find it via other means, you'll need to find it with a search engine. These are some of the best.", "Undoubtedly, the best search engine out there.", "Their natural-language search sometimes comes up with results you won't get with other engines."); var url_array = new Array(num_of_cats); url_array[0] = new Array("#"); // The first category. This should have no items other than "#". url_array[1] = new Array("#", // The second category; the first "real" category. Note the initial #. That is the category which says "Please select a link." It doesn't need a URL. Start putting the other URL's in after that first line. "http://javascriptkit.com/", "http://www.news.com/", "http://www.wired.com/"); url_array[2] = new Array("#", "http://www.cnn.com/", "http://abcnews.go.com/"); url_array[3] = new Array("#", "http://www.google.com/", "http://www.aj.com/"); function switch_select() { for (loop = window.document.form_1.select_2.options.length-1; loop > 0; loop--) { window.document.form_1.select_2.options[loop] = null; } for (loop = 0; loop < option_array[window.document.form_1.select_1.selectedIndex].length; loop++) { window.document.form_1.select_2.options[loop] = new Option(option_array[window.document.form_1.select_1.selectedIndex][loop]); } window.document.form_1.select_2.selectedIndex = 0; } function switch_text() { window.document.form_1.textarea_1.value = text_array[window.document.form_1.select_1.selectedIndex][window.document.form_1.select_2.selectedIndex]; } function box() { if (window.document.form_1.select_2.selectedIndex == 0) { alert("Where do you think you're going?"); } else { if (open_in_newwindow==1) window.open(url_array[window.document.form_1.select_1.selectedIndex][window.document.form_1.select_2.selectedIndex],"_blank"); else window.location=url_array[window.document.form_1.select_1.selectedIndex][window.document.form_1.select_2.selectedIndex] } } function set_orig() { window.document.form_1.select_1.selectedIndex = 0; window.document.form_1.select_2.selectedIndex = 0; } window.onload=set_orig // --> </script> <form name="form_1" onSubmit="return false;"> <textarea WRAP="virtual" name="textarea_1" rows=6 cols=60>Here's how you use this box: First, you select a category in the Category drop-down. Then, select a link from the Link drop-down. Then, read the description in this box, or click Go to go to the page. If you ever need to see this help again, just go back to the top option in the Category box.</textarea><br /> <!-- This should be the same as the general instructions in the above code. --> <select name="select_1" onChange="switch_select(); switch_text();"> <option>-- Categories --</option> <option>Technology Sites</option> <option>News Sites</option> <option>Search Engines</option> </select> <select name="select_2" onChange="switch_text();"> <option>You need to select a category</option> <option> </option> <option> </option> </select> <input type="submit" onClick="box();" value="Go!"> </form> <p align="center">This free script provided by<br /> <a href="http://javascriptkit.com">JavaScript Kit</a></p> hi I wonder if someone out there can help me. I am very new to javascript and i have manged to understand a little of a double combo box with description however I would now like to be able to not only change the comment underneth but also add an image. This image (along with the comment) changes everytime the dropdownbox changes. I just cant seem to add the image. Please can anyone help I would really appreciate it and be extremely grateful. gr T Hello all, I have a form which contains some fields like company_name, address, phone, email etc. Also, I have a database with companies. I want that, when typing the beginning of the company name, a combo box to suggest all companies that match that text. I want that when a company is selected from the combo, all other textboxes to be filled with the correct info from the database. Also, I want that the user to be able to write a company that is not registered in the database. What I have done until now: For the editable combo I used the dhtmlxcombo from he http://dhtmlx.com/docs/products/dhtmlxCombo/ (Filtering mode: (filter existing list)). I'm not a scripting expert, so I think I cannot build this combo all by myself. I modified just one thing. At the begining, the dhtmlxcombo.js file contained something like this: Code: if (tab)z.tabIndex=tab;z.style.width = (width-19)+'px';self.DOMelem.appendChild(z);self.DOMelem_input = z;z = document.createElement('input');z.type = 'hidden';z.name = name;self.DOMelem.appendChild(z);self.DOMelem_hidden_input = z;z = document.createElement('input');z.type = 'hidden';z.name = (name||"").replace(/(\]?)$/, "_new_value$1");z.value="true";self.DOMelem.appendChild(z);self.DOMelem_hidden_input2 = z I added z.id='dest_company';, so the file looks something like this, now: Code: if (tab)z.tabIndex=tab;z.style.width = (width-19)+'px';self.DOMelem.appendChild(z);z.id='dest_company';self.DOMelem_input = z;z = document.createElement('input');z.type = 'hidden';z.name = name;self.DOMelem.appendChild(z);self.DOMelem_hidden_input = z;z = document.createElement('input');z.type = 'hidden';z.name = (name||"").replace(/(\]?)$/, "_new_value$1");z.value="true";self.DOMelem.appendChild(z);self.DOMelem_hidden_input2 = z};dhtmlXCombo_defaultOption.prototype._DrawHeaderButton = function(self, name, width) The text field 'dest_company' is generated like this: PHP Code: <select name="dest_company" id="dest_company" OnChange="SelectReceiver(document.comanda.dest_company.value);" style="width:206px;" tabindex="10"> <?php echo ' <option value=""></option>'; $address_result = mysql_query("SELECT * FROM `webdb_".$_COOKIE['user']."` ORDER BY companie ASC"); while($row = mysql_fetch_array($address_result)) { echo '<option value="'.$row['id'].'">'.$row["companie"].'</option>'; } echo ' </select> <script> var z = dhtmlXComboFromSelect("dest_company"); z.enableFilteringMode(true); </script>'; ?> This is the SelectReceiver() function: Code: function SelectReceiver(id_dest) { if (id_dest=="") { document.getElementById("contact_destinatar").value=""; document.getElementById("adresa_destinatar").value=""; document.getElementById("oras_destinatar").value=""; document.getElementById("judet_destinatar").value=""; document.getElementById("zip_destinatar").value=""; document.getElementById("telefon_destinatar").value=""; document.getElementById("mail_destinatar").value=""; return; } if (window.XMLHttpRequest) {// code for IE7+, Firefox, Chrome, Opera, Safari xmlhttp=new XMLHttpRequest(); } else {// code for IE6, IE5 xmlhttp=new ActiveXObject("Microsoft.XMLHTTP"); } xmlhttp.onreadystatechange=function() { if (xmlhttp.readyState==4 && xmlhttp.status==200) { //document.getElementById("detalii_destinatar").innerHTML=xmlhttp.responseText; var response = eval(xmlhttp.responseText); } } xmlhttp.open("GET","modifica_detalii_destinatar.php?q="+id_dest,true); xmlhttp.send(); } And the file modifica_detalii_destinatar.php looks like this: PHP Code: <?php $q=$_GET["q"]; include ('conectare.php'); $sql="SELECT * FROM `webdb_".$_COOKIE['user']."` WHERE id='".$q."'"; $result = mysql_query($sql); while($row = mysql_fetch_array($result)) { echo ' document.getElementById("contact_destinatar").value = "'.$row['contact'].'"; document.getElementById("adresa_destinatar").value = "'.$row['adresa'].'"; document.getElementById("oras_destinatar").value = "'.$row['oras'].'"; document.getElementById("judet_destinatar").value = "'.$row['judet'].'"; document.getElementById("zip_destinatar").value = "'.$row['zip'].'"; document.getElementById("telefon_destinatar").value = "'.$row['telefon'].'"; document.getElementById("mail_destinatar").value = "'.$row['mail'].'"; '; } ?> All this is working just in Firefox. In IE, when I select a company from the combo box, an error is generated and no text box is completed with the correct data. The error I'm talking about is: Code: 'document.comanda.compania_destinatar.value' is null or not an object In Firefox, if I inspect element with Firebug, my select looks like this: Code: <div style="width: 204px;" class="dhx_combo_box "> <input type="text" autocomplete="off" class="dhx_combo_input" tabindex="10" style="width: 185px;" id="companie_dest"> <input type="hidden" name="dest_company" value="45"> <input type="hidden" name="dest_company" value="false"> <img class="dhx_combo_img" src="codebase_xcombo/imgs/combo_select.gif"> </div> Any help on this would be great. Many thanks and best regards! I was wondering if I could get some help in something. I am working on my church's website, and I previously implemented something called "Reftagger" onto the new website: http://www.logos.com/reftagger It "converts" any bible verse into a hyperlink as well as a tooltip. I thought that this was a neat idea, and wanted to do the same with the Westminster Larger (and Shorter) Catechism as well. Anytime it says "WLC Q58" (for example) I want it to automatically display that specific question and answer. So far, I simply have a basic tooltip and a hyperlink inserted for every WLC Q: http://covenantrpc.freehostia.com/covenant/sermons/ (just look at the page source and you'll see what I did). Then I have the tooltip.js file: http://covenantrpc.freehostia.com/co...ons/tooltip.js What I want to do is create some sort of definition library or glossary. One where it tells the webpage that every time the webpage says "WLC 58" it will be automatically converted into a hyperlink and tooltip, just like Reftagger. Hi all, I have a form which takes some values as input and stores them in a db for another use. I have the following java script to validate the entries. Code: <HTML><HEAD><TITLE>Electronic Deposting Form</TITLE> <script language="JavaScript"> <!-- script start function validateComplete(formObj) { if (emptyField(formObj.username)) alert("Please enter the Username."); else if (emptyField(formObj.passwd)) alert("Please enter the Password."); else if (emptyField(formObj.drop)) alert("Please enter the Drop Folder."); else return true; return false; } // Check to see if field is empty function emptyField(textObj) { if (textObj.value.length == 0) return true; for (var i=0; i<textObj.value.length; ++i) { var ch = textObj.value.charAt(i); if (ch != ' ' && ch != '\t') return false; } return true; } function chklen() { var un = document.getElementById("username").value var len = un.length; if (len > 15) { alert ("ERROR!!Only 15 characters are allowed in Username!!"); document.getElementById("username").value = un.substring(0,15); // remove excess characters } } // script end --> </script> Now I am planning to add a combo box to the form where I have the environment field. Following is the code for the form. Code: <td align="left" valign="top"><FORM name="form" action="../saveDP.cgi" method="post" onSubmit="return validateComplete(document.form)"><TABLE width="100%" cellPadding=2 cellSpacing=2> <TR> <TD width="26%" class="label"><B>Username </B></TD> <TD width="3%" class="label">:</TD> <TD width="71%"><INPUT maxLength=255 size=28 name=username id='username' onkeyup="chklen()"> <TR> <TD class="label" ><B>Password </B></TD> <TD class="label">:</TD> <TD><INPUT type=password maxLength=255 size=28 name=passwd> <TR> <TD class="label"><B> Environment </B></TD> <TD class="label">:</TD> <TD><SELECT class="input" size=1 name=environ> <OPTION value=us selected><b> US </b></OPTION> <OPTION value=uk><b> UK </b></OPTION> </SELECT> </TD> </TR> <TD colspan="3"><table width="100%" border="0" cellspacing="0" cellpadding="0"> <tr> <td width="19%"> </td> <td width="9%"><INPUT type=submit value=Submit v:shapes="_x0000_s1034"> </td> <td width="8%"><input type=reset value=Clear v:shapes="_x0000_s1035\"></td> <td width="64%"> </td> </tr> </table></TD> </TR> As I am new to JS, can anybody help me to implement a combo box( ie first two options are US and UK and third one is a text box which i can enter any value, can't be left blank while submitting the form) with "Environment" field? |