JavaScript - Html Login Help!!!! Urgent Pls Help Me :)
i am having a simple login system, but i need some help i want to assign an if else statement my code is this :
what i need is if i login to sales if navigates to sales page, if other then go to other page pls help me It is very important for me Thanks is 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>ENTER USER NAME ENTER PASSWORD</title> <style type="text/css"> .style1 { text-align: center; } </style> </head> <body style="background-color: #AFC8C7"> <script type = "text/javascript"> // Note: Like all Javascript password scripts, this is hopelessly insecure as the user can see //the valid usernames/passwords and the redirect url simply with View Source. // And the user can obtain another three tries simply by refreshing the page. //So do not use for anything serious! var count = 2; function validate() { var un = document.myform.username.value; var pw = document.myform.pword.value; var valid = false; var unArray = ["HR", "Admin", "IT", "Sales"]; // as many as you like - no comma after final entry var pwArray = ["hr123", "admin123", "it123", "sales123"]; // the corresponding passwords; for (var i=0; i <unArray.length; i++) { if ((un == unArray[i]) && (pw == pwArray[i])) { valid = true; break; } } if (valid) { alert ("Login was successful"); window.location = "index.html"; return false; } var t = " tries"; if (count == 1) {t = " try"} if (count >= 1) { alert ("Invalid username and/or password. You have " + count + t + " left."); document.myform.username.value = ""; document.myform.pword.value = ""; setTimeout("document.myform.username.focus()", 25); setTimeout("document.myform.username.select()", 25); count --; } else { alert ("Still incorrect! You have no more tries left!"); document.myform.username.value = "No more tries allowed!"; document.myform.pword.value = ""; document.myform.username.disabled = true; document.myform.pword.disabled = true; return false; } } </script> <form name = "myform"> <p> </p> <p> </p> <p> </p> <p class="style1">User Name: <input type="text" name="username" style="width: 131px"> </p> <p class="style1"> Password: &nbs p; <input type="password" name="pword" style="width: 131px"> </p> <p class="style1"> & nbsp;   ; <input type="button" value="Log In" name="Submit" onclick= "validate()" style="width: 96px"> </p> </form> <div style="position: absolute; width: 100px; height: 100px; z-index: 1; left: 136px; top: 252px" id="layer1"> </div> <p> </p> </body> </html> Similar Tutorialshi i am trying to populate a textarea with the selections like checkboxes radiobuttons textbox combobox but i cant seem to do so. i am naive to the field of programing, and found a few code snippets to do so i tried but it did no good... help needed this is my code " <html> <head> <style type="text/css"> .minitext { font: normal 0.7em Arial, sans-serif; color: Black; } .disable { background-color: #CF110C; color: #fff; font-weight: bold; padding: 5px; } </style> <script language="Javascript" type="text/javascript"> function populateTextArea(){ var output = new Array(); var fieldID = 1; while (fieldObj = document.MyForm['iid'+fieldID]) { if (fieldObj.length) { for (var j=0; j<fieldObj.length; j++) { if (fieldObj[j].checked) { output[output.length] = fieldObj[j].value;} }//end of for } //end of if else { if (fieldObj.checked) { output[output.length] = fieldObj.value; } }//end of else fieldID++; }// end of while document.getElementById('targetarea').value = output.join(', '); //document.MyForm.targetarea.value = document.MyForm.ip1.value + '\n' + document.MyForm.ip2.value + '\n' + document.MyForm.ip3.value ; } </script> </head> <body> <br> <br> <form name="MyForm" method="POST" action="#"> String 1: <input type="text" name="ip1" value=""><br> String 2: <input type="text" name="ip2" value=""><br> String 3: <input type="text" name="ip3" value=""><br><br> <input type="checkbox" name="iid1" id="pe_item2" value="Text string 1"> Text string <input type="checkbox" name="iid1" id="pe_item2" value="Text string 12"> Text string 1<br><br><br> <input type="radio" name="iid2" id="pe_item4" value="Text string 2">Text string 2 <input type="radio" name="iid2" id="pe_item6" value="Text string 3">Text string 3<br> <input type="radio" name="iid3" id="pe_item8" value="Text string 4">Text string 4 <input type="radio" name="iid3" id="pe_item10" value="Text string 5">Text string 5<br> <input type="radio" name="iid4" id="pe_item12" value="Text string 6">Text string 6 <input type="radio" name="iid4" id="pe_item14" value="Text string 7">Text string 7<br> <br> <br> <a href="#" onClick="document.MyForm.targetarea.value = document.MyForm.ip1.value + '\n' + document.MyForm.ip2.value + '\n' + document.MyForm.ip3.value + populateTextArea();" >Populate</a><br> <br> <INPUT TYPE=BUTTON VALUE="Co" ONCLICK= populateTextArea(); > <br> <textarea id="targetarea" name ="targetarea" cols="50" rows="5"></textarea> </form> </body> </html> " help need this done urgently Hello there guys! Thanks for taking time to view this thread. It's appriciated! I found a really nice menu (Javascript, JQuery) im not so high tech on this myself, and not the best coder either but whenever I use this menu it gives the login box on the website an error, it doesn't let people login.. I've tried to localize the error myself, but I just dont know how to fix it, I think the issue is that the site system i use doesn't support these type of scripts which gives the login errors! I'm currently using a free website system, which allows you to customize anything you want called "uCoz" The menu i used was: http://www.dynamicdrive.com/dynamici...enu-glossy.htm And I think it's the jquery that gives the login box errors.. I'm thankfull for answers if anyone knows Hello everyone. I have a a html page that is used as a login page. I know it is not secure but this is just for learning purposes, I'm not using it for anything important. My problem is that when I put in the correct login all that happens is the page just clears the text boxes as if you were starting over. I am trying to get it to go to register.html which is located in the same directory as the login page. Help with what I'm doing wrong would be greatly appreciated. Here is the code: Code: <html> <head> <title>Login Page</title> </head> <body> <script type = "text/javascript"> var count = 2; function validate() { var un = document.myform.username.value; var pw = document.myform.pword.value; var valid = false; var unArray = ["Philip", "George", "Sarah", "Michael"]; // as many as you like - no comma after final entry var pwArray = ["Password1", "Password2", "Password3", "Password4"]; // the corresponding passwords; for (var i=0; i <unArray.length; i++) { if ((un == unArray[i]) && (pw == pwArray[i])) { valid = true; break; } } if (valid) { alert ("Login was successful"); window.location = "register.html"; return false; } var t = " tries"; if (count == 1) {t = " try"} if (count >= 1) { alert ("Invalid username and/or password. You have " + count + t + " left."); document.myform.username.value = ""; document.myform.pword.value = ""; setTimeout("document.myform.username.focus()", 25); setTimeout("document.myform.username.select()", 25); count --; } else { alert ("Still incorrect! You have no more tries left!"); document.myform.username.value = "No more tries allowed!"; document.myform.pword.value = ""; document.myform.username.disabled = true; document.myform.pword.disabled = true; return false; } } </script> <form> <table border ="5"> <tr> <th colspan="2">Login</th> </tr> <tr> <td>Username:</td> <td><input type="text" name="username" /></td> </tr> <tr> <td>Password:</td> <td><input type="password" name="pword" /></td> </tr> <tr> <th colspan="2"><input type="Submit" value="Login" name="Submit" onClick="validate()" /><input type="Reset" value="Reset" /></th> </tr> </table> <p> <a href="register.html">New users click here to register</a> </p> </form></body></html> I'm a newbie to php and javascript. I want some checkbox to hide some rows of my table so i did a search and i found a few javascript codes but yet I couldn't make it work the way I wanted it. When I uncheck a checkbox ONLY the first table rows get hidden, the other tables don't? can't I ID some rows? Please I need help :( My javascript code is: Quote: <script type="text/javascript"><!-- function showHideTR(idx,vis) { var tbl,row; if(document.getElementById && document.getElementsByTagName) { tbl = document.getElementById('tbl'); if(!tbl || (idx >= tbl.getElementsByTagName('tr').length)) return; row = tbl.getElementsByTagName('tr')[idx]; } else if(document.all && document.all.tags) { // IE4 support tbl = document.all.tbl; if(!tbl || (idx >= tbl.all.tags('tr').length)) return; row = tbl.all.tags('tr')[idx]; } if(row) { if(!vis) { row.style.display = 'none'; } else { // conditional compilation to hide the try-catch blocks from IE4 /*@cc_on @if(!@_jscript || (@_jscript_version >= 5)) @*/ try { row.style.display = 'table-row'; } catch(e) { row.style.display = 'block'; } /*@elif(@_jscript_version < 5) row.style.display = 'block'; // for IE4 @end @*/ } } } function getStyle(el,styleProp) { var x = (typeof(el)=='string')?document.getElementById(el):el; if (x.currentStyle) var y = x.currentStyle[styleProp]; else if (window.getComputedStyle) var y = document.defaultView.getComputedStyle(x,null).getPropertyValue(styleProp); return y; } window.onload = function() { if(!document.getElementsByTagName) return; var tds = document.getElementsByTagName('td'); for(var i=0;i<tds.length;i++) { tds[i].onclick = function() { alert(this.parentNode.tagName+' = display : '+getStyle(this.parentNode,'display')+ '\n'+this.tagName+' = display : '+getStyle(this,'display')); } } } // --> </script> <!-- <script type="text/javascript"> function showHideTR(idx,vis) { var tbl,val; val = (!vis)?'none':((document.defaultCharset && !window.home)?'block': 'table-row'); if(document.getElementById && document.getElementsByTagName) { tbl = document.getElementById('tbl'); if(idx >= tbl.getElementsByTagName('tr').length) return; tbl.getElementsByTagName('tr')[idx].style.display = val; } else if(document.all && document.all.tags) { // IE4 support tbl = document.all.tbl; if(idx >= tbl.all.tags('tr').length) return; tbl.all.tags('tr')[idx].style.display = val; } } </script> --> My option tags: Quote: <form action="#" onsubmit="return false;"> <ul> <li2><label for="cb0"><input type="checkbox" id="cb0" checked="checked" onclick="showHideTR(0,this.checked);"> Blah Blah</label></li> <li2><label for="cb1"><input type="checkbox" id="cb1" checked="checked" onclick="showHideTR(1,this.checked);"> Blah Blah2</label></li> <li2><label for="cb2"><input type="checkbox" id="cb2" checked="checked" onclick="showHideTR(2,this.checked);"> Blah Blah3</label></li> <li2><label for="cb3"><input type="checkbox" id="cb1" checked="checked" onclick="showHideTR(3,this.checked);"> Blah Blah4</label></li> </ul> </form> My php page: Quote: <?php $host = "localhost"; // your host name $username = "blah blah"; // your user name to access MySql $password = "blah blah"; // your password to access MySql $database = "blah blah"; // The name of the database $no = $_POST["sureno"]; //$link = mysql_connect($host,$username,$password); if (!$link = @mysql_connect($host,$username,$password,true)) {die('Could not connect:'. mysql_error()); } @mysql_query("SET NAMES 'latin5'"); @mysql_select_db($database) or die( "Unable to select database"); $sql="SELECT * FROM blah blah WHERE sure = '$no' ORDER BY 'id'"; $result = mysql_query($sql); if (!$result) { die('Invalid query: ' . mysql_error()); } while($row=mysql_fetch_assoc($result)){ $bgcolor="#f1f1f1"; echo "<TABLE width=50% align=center cellpadding=0 cellspacing=0 id='tbl' summary='demonstration'> <tr>"; echo "<td bgcolor='dfdfdf' ><font face='arial,verdana,helvetica' color='#000000' size='3'>blah blah</font></td>"; echo "<td bgcolor='C0C0C0' ><font face='arial,verdana,helvetica' color='#FF0000' size='4'>" . $row['AB'] ."</font></td></tr>"; echo "<tr><td bgcolor='dfdfdf' ><font face='arial,verdana,helvetica' color='#000000' size='3'>blah blah</font></td>"; echo "<td bgcolor='dfdfdf'> <font face='arial,verdana,helvetica' color='#0080C0' size='2'>". $row['TR'] ."</font></td></tr>"; echo "<tr><td bgcolor='dfdfdf' ><font face='arial,verdana,helvetica' color='#000000' size='3'>blah blah</font></td>"; echo "<td bgcolor='dfdfdf' id='cb0'> <font face='arial,verdana,helvetica' color='#000000' size='3'>". $row['ML'] ."</font></td></tr>"; } mysql_free_result($result); ?> I am a beginner so please help ASAP. When I validate my code in validate.w3.org: document.write("<img src='" + myNum +".jpg'/>"); I got an error that said: --- required attribute "alt" not specified I have a page in html, containing some text like " ABCDEFGHIJKL" etc. This text has also a website link (hyperlink) with it. This website link changes on each refresh of page. Such link changes due to javascript runing behind on it. I just want this link each time stored in a PHP variable. Such text always appears on a certain position on the page (X,Y). Can you please help me on it.? I can provide additional details on request. Your early answer is required. Regards Ahmed Taufiq im new beginner for jsp coding and java script programming..here,i have a few question about date calculation. 1.duration date between date signed and expired date = display in year 2. from expired date available years, month and day minus with Date Today 3. how to use IF ELSE statement to display status active or inactive (example : active status if more then 8 month or inactive status if less then 8 month) this is my coding...it's right? for years <script language="JavaScript" type="text/javascript"> /*<![CDATA[*/ function DaysMonths(but,nme,op){ var frm=but.form; var dates=frm[nme]; for (var i=0; i<dates.length; i++){ var date=dates[i].value.split('-'); dates[i].date=new Date(date[0]*1,date[1]-1,date[2],0,0,0,0); } var days=(dates[1].date-dates[0].date)/1000/60/60/12; years=(dates[1].date.getFullYear()-dates[0].date.getFullYear()); frm[op].value=years+' years'; } /*]]>*/ </script> i have output : 5 years for month and day <script language="JavaScript" type="text/javascript"> /*<![CDATA[*/ function DaysMonth(but,nme,op){ var d = new Date(); var frm=but.form; var dates=frm[nme]; for (var i=0; i<dates.length; i++){ var date=dates[i].value.split('-'); dates[i].date=new Date(date[0]*1,date[1]-1,date[2],0,0,0,0); } var days=(dates[1].date-dates[0].date)/1000/60/60/24s; var months=dates[1].date.getMonth()-dates[0].date.getMonth(); months=(dates[1].date.getFullYear()-dates[0].date.getFullYear()-d.getDate())*12+(months<0?months:-months); frm[op].value= months + ' month ' +days+ ' day '; } /*]]>*/ </script> my output i have like this : 48 month 1826 day i set date format in my sql like this date signed = 2008-11-18 date expired = 2013-11-18 how can i have output like this for for duration (date expired - date signed) minus date for today = 3 year, 42 month 1826 day sorry for my thread post this morning...not mean like that... Hi Guys, I am implementing this Javascript in my summer internship. What I want to do is, 1) Show a Pop up alert with a Countdown timer( 10, 9, 8, 7 ....) after 5 minutes. 2) If user doesn't click "Ok" within the time, the page will automatically Redirect to another page. Eg- Login Page. 3) If the User clicks the "Ok" button the Page will not get re-direct. 4) Also, once the Timer countdown completes and the page redirection is done, the User when he will see the Login page will see an alert box saying. 'Your session has expired, plz login again' he clicks 'Ok' and Login again. I am very new to this Java script, but need to finish this project. Plz help me out. can any one please help me out with the code. I am passing an URL for ex: www.example.com?req=23¶m=25 What i need to do is I need to remove the parameters after "?" which I did using the spilt method, Can anyone help me out now how do I send the complete URL with the parameters as hidden. what I mean is..my URL should look like www.example.com. but the second part (parameter shud be hidden). here's what I have so far Code: <html> <head> <script> MONTHS_OF_THE_YEAR = 'janfebmaraprmayjunjulaugsepoctnovdec'; MILLISECONDS_DAY = 1000*60*60*24; MILLISECONDS_YEAR = 1000*60*60*24*365.2424; LIFE_EXPECTANCY = 1000*60*60*24*365.2424*67.2; var daysArray = new Array ('Sunday','Monday','Tuesday','Wednesday','Thursday','Friday','Saturday'); var yearBirth = ''; yearBirth = prompt('Please enter your year of birth'); var monthBirth = ''; monthBirth = prompt('Please enter your month of birth'); monthBirth = monthBirth.slice(0,3); monthBirth = monthBirth.toLowerCase(); monthBirth = MONTHS_OF_THE_YEAR.indexOf(''+monthBirth)/3; var dateBirth = ''; dateBirth = prompt('Please enter your date of birth'); var usersInputDate = new Date (yearBirth, monthBirth, dateBirth); var dd = new Date((monthBirth+1).toString() + "/" + dateBirth + "/" + yearBirth); dd=dd.getDay(); var now = new Date(); usersInputTime = (usersInputDate.getTime()); usersInputTime = parseInt(now.getTime()-usersInputTime); var ageYears = (usersInputTime/MILLISECONDS_YEAR); var ageDays = (usersInputTime/MILLISECONDS_DAY); var avgLife = (usersInputTime/LIFE_EXPECTANCY*100); document.writeln('<h1>It\'s about time...</h1>'); document.writeln('<ul>'); document.writeln('<li> </li>' </script> </head> <body> </body> </html> I need to do the following and have no idea Quote: What will be output (to the document using write())? A heading 1 title with the text It's about time... An unordered list containing appropriate wording as strings concatenated with: The weekday name for the user's birth date Use the day of the week number as an index into the weekday names array The user's age in years Present this as a fixed format number with 2 decimal places The user's age in days Present this as a fixed format number with 0 decimal places The percentage of an average life expectancy Present this as a fixed format number with 0 decimal places please help i need to get this done tonight Hi I'm trying to create a javascript function that will ask a user for a character and check that character against a string containing other characters. If the character is present in the string the function should then ask the user to input another character. it should keep doing this until a charater is entered that doesnt appear in the check string. I am pretty new to javascript and have been working for about 2 days trying to get this to work. I have an assignment due next week 21.09.09 and need to get it sorted before then. Any help or pointers would be great. One stipulation that the assignment is asking for is that you have to use the indexOf method to interigate the string. I have attached the code below. Any help or pointers would be brilliant. var incorrectString = 'abcdef'; var correctString = 'ghi'; function getInput(aString) { } getInput(incorrectString + correctString); Hi, i am new to javascript and i am giving a task to create a javascript page, i need a javascript that will calculate and generate a simple Quotation with total price of item selected and its quantity in a new page and in tabular form, i need this for 2 check-boxs that has the value, 2 dropdownlist and the price.
Hai everyone, I am a newbie to javascript.I have a scenario where I have two sets of textboxes,one that holds the percentage and other holds the percenteage value. Below them,I have a total value of which the percentage values will be stored. Can anyone help me in writing the javascript code in finding the percentage value of the total number given below and storing it in a text box. Any help,I need it urgent Hi I'm trying to download the security image from this site (at the bottom): http://pacesalsa.promotionexpert.com...2/register.jsp However, every time one refreshes the image, the image changes (obviously). So, I'm trying to figure out how to download the current image on the page to a jpg or png (or any image file type). Could someone please tell me how to do this? Thanks. <!DOCTYPE html> <html lang="en"> <head> <meta charset="utf-8"> <title>Get personal details</title> <!-- meta tags --> <meta name="keywords" content=""> <meta name="description" content=""> <!-- stylesheets --> <link rel="stylesheet" href="css/reset.css" type="text/css"> <link rel="stylesheet" href="css/common.css" type="text/css"> <!-- javascript --> <script src="js/jquery-1.3.2.min.js"></script> <!--conditional comments --> <!--[if IE]> <script src="js/html5.js"></script> <![endif]--> <script language="javascript" type="text/javascript"> function validName(n,c,l,d) { if(n.length == 0) { window.alert('A name must not be empty!'); return false; } if(c.length == 0) { window.alert('A country must not be empty!'); return false; } j = -1; for(i = l.length-1;i > -1;i--) { if(l[i].checked) { j = i;i = -1; } } if(j == -1) { window.alert('A like must not be empty!'); return false; } t = -1; for(s = d.length-1;s > -1;s--) { if(d[s].checked) { t = s;s = -1; } } if(t == -1) { window.alert('A dislike must not be empty!'); return false; } return true; } </script> </head> <body class="home"> <article id="page-content"> <section> <hgroup> <h2>Get personal details</h2> </hgroup> <form method="get" action="show_details.php" onSubmit="return validName(this.name.value,this.country.value,this.likes,this["dislikes[]"]);"> <table class="bordered"> <caption>Personal details form</caption> <tr> <th class="col1"> Property </th> <th class="col2"> Value </th> </tr> <tr> <td class="col1"> Name </td> <td class="col2"> <input type="text" name="name" size=30> </td> </tr> <tr> <td class="col1"> Age </td> <td class="col2"> <select name="age"> <option> 0-10 </option> <option> 11-20 </option> <option> 21-30 </option> <option> 31-40 </option> <option> 41-50 </option> <option> Over 50 </option> </select> </td> </tr> <tr> <td class="col1"> Country </td> <td class="col2"> <input type="text" name="country" size=30> </td> </tr> <tr> <td class="col1"> Likes </td> <td class="col2"> <input type="radio" name="likes" value="swimming">Swimming<br> <input type="radio" name="likes" value="running">Running<br> <input type="radio" name="likes" value="dancing">Dancing<br> <input type="radio" name="likes" value="biking">Biking<br> <input type="radio" name="likes" value="surfing">Surfing<br> </td> </tr> <tr> <td class="col1"> Dislikes </td> <td class="col2"> <!-- The value of dislikes is an array of checked values --> <input type="checkbox" name="dislikes[]" value="dogs">Dogs<br> <input type="checkbox" name="dislikes[]" value="cats">Cats<br> <input type="checkbox" name="dislikes[]" value="birds">Birds<br> <input type="checkbox" name="dislikes[]" value="fish">Fish<br> <input type="checkbox" name="dislikes[]" value="plants">Plants<br> </td> </tr> <tr> <td class="col1"> Description </td> <td class="col2"> <textarea name="description" rows=6 cols=30></textarea> </td> </tr> <tr> <td colspan=2 style="text-align: center"> <input type="submit" name="submit" value="Submit"> <input type="reset" name="reset" value="Reset"> </td> </tr> </table> </form> </section> </article> </body> </html> I cant for the life of me find out why it wont display the javawindow anymore? suppose to pop up when you dont enter a name, country, check a radio or checkbox is it possible to open all file of a folder with multiple folders inside in turn opening all files. basically i have some sites i need to fully edit but i rather work with every file from the website open i need to open every file in a folder of files in other folder help i cant go one by one it would take forever.
I want to insert image instead of those empty boxes.......can someone help me please...... <script type="text/javascript"> document.write("<html><head><title>My PhotoCollage</title></head><body>"); function makeDiv() { var r = Math.floor(Math.random()*256); var g = Math.floor(Math.random()*256); var b = Math.floor(Math.random()*256); var wh = 25 + Math.floor(Math.random()*444); var lr = (Math.random()<.5) ? "top":"right"; var bw = 1 + Math.floor(Math.random()*12); var bs = (Math.random()<.5) ? " solid":"dotted"; var dc = (Math.random()<.5) ? "Dog" : "Cat"; var Img = Math.floor(Math.random()*256); document.write("<div style=\"float: "+lr+";"+ "width: "+wh+"px;"+ "height: "+wh+"px;"+ "border: rgb(" + g + "," + b + "," + r + ") "+bw+"px "+bs+";"+ "background-color: rgb(" + r + "," + g + "," + b + ");"+ "image: "\">"+dc+ "</div>"); } var i; var count = Math.floor(Math.random()*100) + 5; for (i=0; i<count; i++) makeDiv(); document.write("</body></html>"); </script> I have been trying for hours to do the following: - Change the background of a div by clicking a link from another div tag. - It also needs to change back when clicked again. I know there are alot of experienced coders out there and I'm eager to learn... help would be appreciated! I am not a JavaScript resource , on an urgent basis I need to create a GUI screen with the help javascript for running reports i.e. the parameters would be passed to reports that are to be run. My requirement is to create : User friendly drop down box A date field with calender in it so taht value can be selected from the calender and passed on to the database. A option on the GUI that would create a csv file on the server. ===================[ URGENT ]================= confirm_state is not working properly..as it uses sajax..it is supposed to get the value of the state ..but the state being a string not working...please help.. ........................urgent......... <? function search_states($str) { //print $str; //print "<br><pre>"; $number=explode('-',$str); //print_r($number); //print $number[0]; if(count($number)==1) { $table='states'; $data=array('*'=>''); $fldarray=array("state"=>$number[0]); $val=dataSelectSearch($table,$data,$fldarray,$extra,$orderArray,$orderType); // print "<pre>"; // print_r($val); for($i=0;$i<count($val);$i++) { $state_name=$state_name."##".$val[$i]['state']; } return $state_name; } else { $strt_val=ord($number[0]); // Ascii of first character $end_val=ord($number[1]); // Ascii of last character //print chr($end_val); for($j=$strt_val;$j<=$end_val;$j++) { $table='states'; $data=array('*'=>''); $fldarray=array("state"=>chr($j)); $val=dataSelectSearch($table,$data,$fldarray,$extra,$orderArray,$orderType); for($m=0;$m<count($val);$m++) { $state_name=$state_name."##".$val[$m]['state']; } } return $state_name; } } ?> <script> function confirm_state1(msg) { // =============================== [subcategory follows ] ========================= //alert(msg); var value=msg; var arr=Array(); arr=value.split("##"); for(i=1;i<=(arr.length-1);i++) { //var new_val; //alert(i); //var int=Integer.valueOf(arr[i]); document.getElementById('innercontent').innerHTML=document.getElementById('innercontent').innerHTML+ "<br> <a href='javascript:void(0);' onclick='document.getElementById(state_name).value="+arr[i]+";' class='small_link1'>"+arr[i]+"</a>"; //document.getElementById('all_state').innerHTML=''; //alert(document.getElementById('innercontent').innerHTML); } } function showname(val) { //alert(msg1); alert(val); document.getElementById('state_name').value=val; document.getElementById('all_state').style.display='none'; } function findstate(str) { //alert(str); document.getElementById('innercontent').innerHTML=''; document.getElementById('all_state').style.display='inline'; var str1=str; x_search_states(str1,confirm_state1); } </script> |