JavaScript - Error Message - What's Wrong?
Can anyone help me with the following error message and correlating script please. I think it's just a simple omission. Any help appreciated. Thanks
Microsoft VBScript compilation error '800a0400' Expected statement /shop$db.asp, line 3083 end sub ^ sub ShopWriteHeaderBox (msg) %> <div class="comment_title fontbold"><%=msg%></div> <div class="comment_text"> <div class="blog_review_container" > <% end sub sub ShopWriteFooterBox (yesbr) %> </div> </div> <% if lcase(trim(yesbr)) = "yes" then %> <br /> <% end if end sub Similar TutorialsI can't seem to shake this error message. Here is the code I am working with PHP Code: <tr> <td> <img onClick="showUser(1,\''.$time.'\');" src="'.$this->getPhoto($array[0][1]['uid'],'').'" > </td> <td> <img onClick="showUser(2,\''.$time.'\');" src="'.$this->getPhoto($array[0][2]['uid'],'').'" > </td> <td> <img onClick="showUser(3,\''.$time.'\');" src="'.$this->getPhoto($array[0][3]['uid'],'').'" > </td> <td> <img onClick="showUser(4,\''.$time.'\');" src="'.$this->getPhoto($array[0][4]['uid'],'').'" > </td> and the function PHP Code: '.$this->get_javascript_array($this->data,'data').' function showUser(arr, time) { var likes; var comments; switch(time) { case "Day": likes = data['day\'][0][arr][\'likes\']); comments = data[\'day\'][0][arr][\'comments\']); break; case "Week": likes = data[\'week\'][0][arr][\'likes\']); comments = data[\'week\'][0][arr][\'comments\']); break; case "Month": likes = data[\'month\'][0][arr][\'likes\']); comments = data[\'month\'][0][arr][\'comments\']); break; case "Year": likes = data[\'year\'][0][arr][\'likes\']); comments = data[\'year\'][0][arr][\'comments\']); break; } }; </script> '; I keep getting the following error and it's driving me nuts PHP Code: missing ; before statement [Break on this error] likes = data['day'][0][arr]['likes']);n hi guys, im not very good with javascript/jquery, i have the following code: Code: <script src="http://code.jquery.com/jquery-latest.js"></script> <script> $(window).ready(function() { $("#responsecontainer").load("includes/inc-mess-jail.php", function(response, status, xhr) { }); var refreshId = setInterval(function() { $("#responsecontainer").load('includes/inc-mess-jail.php?randval='+ Math.random()); }, 9000); $.ajaxSetup({ cache: false }); }); </script> it basically updates the div tag: Code: <tr> <td colspan="2"> <div id="responsecontainer" align="center"></div> </td> </tr> i wanted to add an error message to it, that comes up underneath the <div id="responsecontainer" align="center"></div> that says "Error" with an id number next to it, then when your mouse goes over it a box comes out saying "there was a problem retrieving your information. the game will continue trying to resolve this" and then underneath where it says error i would like it to say the number of attempts it has tried to recollect the information. obviously i would only like this error message to come up, when it cannot refresh the information. Any help would be great, even pointing me in the right direction Hi there, I have this form that validates a few textboxes & a dropdownlist. And when it is not filled in, the border of the textboxes and dropdownlist would turn red, followed by an alert message notifying which field have not been filled in. Else, the border will revert back to black, and the form will be submitted successfully. There's a problem whereby when everything is filled in, the alert message still pops up. Any kind souls to help me? Thanks in advance. Javascript Code: function check(checkForm) { var fields = new Array("Name","Email Address", "Domain Name"); var index = new Array(),k=0; for(var i=0;i<fields.length;i++) { var isFilled = false; var c = document.getElementsByName(fields[i]); for(var j = 0; j < c.length; j++) if(!c[j].value == "") { isFilled = true; c[j].className = "defaultColor"; } else { c[j].className ="changeToRed"; } if(!isFilled) { index[k++] = fields[i]; } } if(k.length!=0) { joinComma = index.join(', '); alert('The field(s) corresponding to '+ joinComma + ' is/are not selected.'); return false; } } HTML Code: *Last Name: <input type="text" id="Text27" name="Last Name" /><br /> <br /> *Email Address: <input type="text" id="Text28" name="Email Address" /> @ <select id="Select5" name="Domain Name"> <option></option> <option>hotmail.com</option> <option>yahoo.com</option> </select> <input id="Submit5" type="submit" value="Submit" onclick="return check(checkForm)"/> How Do I Put An Error Message In This Age vervication htm page Below? ---------------------------------------------------------------------- <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"> <link rel="shortcut icon" href="http://cdn.battlefieldbadcompany2.com//misc/favicon.ico" type="image/x-icon"> <link type="text/css" rel="stylesheet" media="all" href="./agegate_files/css_2b22bb76f86419edef5093a148bae2d9.css"> <link type="text/css" rel="stylesheet" media="print" href="./agegate_files/css_d34ed7daed866afd03ff14a52c469b82.css"> <!--[if IE]> <link type="text/css" rel="stylesheet" media="all" href="http://battlefieldbadcompany2.com/sites/all/themes/zen_ninesixty/css/ie.css?D" /> <![endif]--> <script type="text/javascript" src="./agegate_files/js_07d74692b8bac063e891abbaba65653e.js"></script> <script type="text/javascript"> <!--//--><![CDATA[//><!-- jQuery.extend(Drupal.settings, { "basePath": "/", "thickbox": { "close": "Close", "next": "Next \x3e", "prev": "\x3c Prev", "esc_key": "", "next_close": "Next / Close on last", "image_count": "Image !current of !total" } }); //--><!]]> </script> </head> <body class=" agegate"> <div id="wrapper"> <div id="page" class="container-12"> <div id="site-header"> <div id="header-inner" class="grid-12"> </div> </div> <!-- End 'site-header' --> <div class="agegate-block"> <div class="agegate-header"> <h2>Enter your age</h2> </div> <div class="content"> <img src='enterage.gif' /> <form action="./agegate_files/agegate.htm" accept-charset="UTF-8" method="post" id="agegate-form" class="agegate-form"> <div><div class="languages"><h3>Country ( US ONLY )</h3><div class="flag-wrapper"><div><ul> <li class="en"> <a class="active" href="agegate.htm"> <img height="20" width="36" title="English" alt="English" class="language-icon" src="./agegate_files/en.gif"> </a> </li> </ul></div></div></div><div class="form-item" id="edit-age-wrapper"> <input type="text" maxlength="2" name="age" id="edit-age" size="2" value="" class="form-text agegate-age-input"> </div> <div class="form-item"><a href='index.htm'><input type="submit" name="op" id="edit-submit" value="Continue" class="form-submit agegate-submit-btn"></a> </div><input type="hidden" name="form_build_id" id="form-6167175a48bd92c722f6decc9d1c5ac7" value="form-6167175a48bd92c722f6decc9d1c5ac7"> <input type="hidden" name="form_id" id="edit-agegate-form" value="agegate_form"> </div></form> </div> </div> </div> <!-- End 'page' --> </div> <!-- End 'wrapper' --> <div id="omnitureWrapper" style="display: none;"><script language="javascript" src="./agegate_files/utils.js"></script> <script language="JavaScript"><!-- var language = "en"; omniture="home"; var country = ""; var category = ""; var host = ""; switch(language) { case "en": country = "us"; category = "NA"; language = "en-US"; host = "eaeacom,eaeacomna,eaeabrandna,eagamebfbc2na,eagamebfbc2global"; break; case "en-gb": country = "uk"; category = "EMEA"; language = "en-GB"; host = "eaeacom,eaeacomeu,eagamesuk,eagamebfbc2uk,eagamebfbc2global"; break; default: country = "us"; category = "NA"; language = "en-US"; host = "eaeacom,eaeacomna,eaeabrandna,eagamebfbc2na,eagamebfbc2global"; break; } var s_account=omniCheckHost(host) var s_imageDisableFlag = 0; //--></script> <script type="text/javascript" language="JavaScript" src="./agegate_files/s_code_remote_v02.js"></script> <script language="JavaScript"><!-- s_ea.server="" s_ea.channel="" s_ea.prop1=s_ea.setUserState('No ID') s_ea.prop2="BFBC2" s_ea.prop3="GAMES" s_ea.prop4="BATTLEFIELD" s_ea.prop5= "BFBC2"; s_ea.prop7= "DICE"; s_ea.prop9= "MKT"; s_ea.prop10= "Agegate"; s_ea.prop11= category; s_ea.prop12= language; s_ea.prop15= "General Info"; s_ea.prop17= country.toUpperCase(); s_ea.prop18= country.toUpperCase()+":BFBC2"; s_ea.pageName=category+":"+country.toUpperCase()+":"+s_ea.prop3+":"+s_ea.prop7+":"+s_ea.prop9+":"+s_ ea.prop4+":"+s_ea.prop2+":"+s_ea.prop5+":"+s_ea.prop10.toUpperCase(); /* E-commerce Variables */ s_ea.eVar1="No ID"; s_ea.eVar3="BFBC2"; s_ea.eVar17=country.toUpperCase(); s_ea.eVar18=category ; s_ea.eVar29=s_ea.setInitValOnce(country.toUpperCase()+":"+s_ea.prop2+":"+s_ea.prop5); s_ea.eVar30=country.toUpperCase()+":"+s_ea.prop2+":"+s_ea.prop5; s_ea.eVar34="GAMES";/************* DO NOT ALTER ANYTHING BELOW THIS LINE ! **************/ if((s_imageDisableFlag == null) || (typeof (s_imageDisableFlag) == "undefined") || (!s_imageDisableFlag)){var s_code=s_ea.t();if(s_code)document.write(s_code);}//--></script><!-- End SiteCatalyst code version: H.0. --><script language="javascript" type="text/javascript" src="./agegate_files/omniture_wrapper.js"></script></div> </body></html> First post - spent the whole afternoon trying to figure it out and have hit a wall. I'm trying to check a database of lotto numbers against 3 different values and have gotten it that to work. What I need is to give a feedback message if no match is found once the submit button is clicked. Code: function winCheck() { var grandPrize = $('#grandPrize').val(); var otherPrize = $('#otherPrize').val(); var addPrize = $('#addPrize').val(); var resultrange = $('#resultrange').val(); db.transaction( function(transaction) { transaction.executeSql( 'SELECT * FROM entries WHERE daterange = ? ORDER BY lottonum;', [resultrange], function lottoCompare(transaction, result){ for (var i=0; i < result.rows.length; i++) { var row = result.rows.item(i); rowData = [row.lottonum]; rowStr = rowData.toString(); //the if else statements should go here. if (rowStr == grandPrize){ alert('The lotto number ' + grandPrize + ' is a jackpot winner'); } if (rowStr.slice(-7) == otherPrize.slice(-7)){ alert('The lotto number ' + rowStr + ' is a winner of $40,000'); } if (rowStr.slice(-6) == otherPrize.slice(-6)){ alert('The lotto number ' + rowStr + ' is a winner of $10,000'); } if (rowStr.slice(-5) == otherPrize.slice(-5)){ alert('The lotto number ' + rowStr + ' is a winner of $4,000'); } if (rowStr.slice(-4) == otherPrize.slice(-4)){ alert('The lotto number ' + rowStr + ' is a winner of $1,000'); } if (rowStr.slice(-3) == otherPrize.slice(-3)){ alert('The lotto number ' + rowStr + ' is a winner of $200'); } if (rowStr.slice(-3) == addPrize){ alert('The lotto number ' + rowStr + ' is a winner of $200'); } } }, errorHandler ); } ); return false; } Any help is appreciated Hi, I have dozens of pages on my website which have just started showing an 'Error on page' message at the bottom left of Internet Explorer 8.0. These messages do not appear when using Mozilla Firefox. My website is www.lakesandcumbria.com and an example of a page showing the error message is http://www.lakesandcumbria.com/view/walks/ambleside.htm which contains a javascript drop down list. All other pages using this type of drop down list are showing the same error message (dozens of them). I have ensured that 'Script debugging' is disabled in Internet Explorer but this hasn't helped! Help - How can I stop this happening in Internet Explorer 8.0 please? Hi guys im trying to give users a warning message with javascript when the submit my login form without inserting any new data. But I can't seem to find out how to stop the form from going to the login.php here is my code. Code: <form name="te" onsubmit='login();' action='login.php' method='post'> <input name='username' maxlength='14' value='Username' type='text' /> <input name='password' maxlength='20' value='Password' type='password' /> <input type="submit" name="login" value="Login" /> </form> javascript: Code: <script type="text/javascript"> function login() { var username = document.te.username.value; var password = document.te.password.value; if (username == 'Username' || username == '') { alert('empty username!'); return false; } else { if (password == 'Password' || password == '') { alert('empty pass'); return false; } } return true; } </script> Hi, first post here. I was working on code for opening a link in a new window when clicked. I read somewhere that it's a good idea to remove all of the javascript elements from the HTML. So I pieced it together and it works. But I get the following error in IE8: Code: Message: 'document.getElementById(...)' is null or not an object Here's the relevant HTML: Code: <a href="http://www.samplesite.com" id="sampleid">Sample Text</a> And here's the relevant javascript that I put in a seperate .js file: Code: function samplefct() { window.open(this.href);return false; } window.onload = function() {document.getElementById("sampleid").onclick = samplefct; } The code does work as planned. But I'd still like to get rid of the error. Can anybody think of a different way of stating the javascript that would perform the same thing and lose the error? Any help would be greatly appreciated. Thanks! IB Hi Friends, I am come with a new query in jQuery. I have a listing form in which the details showed , the View more Details is implemented using Ajax. When Click "+" sign there is a loading image show First then the Result show there ... It's all working Fine , But I need a way to show Error I mean some time Server Response is success with Empty String on that time I need to catch same .... I explain code Below: Code: if(proceed) { $.ajax({ type: "POST", data: "key="+id, dataType: 'json', async: true, url: "<?php echo site_url(); ?>/server/view_serverdet/", beforeSend: function() { $('#view_load'+id).show(); $('#view_load'+id).addClass(class); }, complete: function(){ $('#view_load'+id).hide(); } }, success: function (server_msg) { if (null == server_msg) { var warning = "<font color=\"red\">Unable to load server details</font>"; $('#view_load'+id).html(warning); } else { // Working Fine! } But that error Just Show and Hide ... How I can show that Error there, If you have any idea , pls help me ASAP... Thankfully Anes P.A Hi, I have written a function to compare each character in startString with another nominated character (nomChar). If they are the same this character is written to outputString, in the same position. If they are not the same a character is lifted from the same position in altString and placed in the same position in outputString instead. I hope that's clear! Code as follows: Code: function compareChar(startString, altString, nomChar) { var outputString = ''; outputString.length = startString.length; var nextLetter = ''; for (var count = 0; count < startString.length; count = count + 1) { nextLetter = startString.charAt(count); if (nextLetter == nomChar) { outputString.charAt(count) = nextLetter; } else { outputString.charAt(count) = altString.charAt(count); } } } document.write(compareChar('boston', 'denver' , 'o' ) ); However, the line of code within the if statement Code: outputString.charAt(count) = nextLetter; keeps generating an 'Invalid assigment left hand side' error message. Can anyone see why this is the case? Thanks. I have a CSS file associated with this that sets the width at "200px." However, I am getting a 40px wide dropdown. Can anybody catch an error in here? Using console.log, I found that el, as soon as it is defined, is = div.dropdown. As soon as .width comes into the picture, it returns as six consecutive 101px and a ton of 40px after that... and continues returning those values till the end. I appreciate any input!! Code: var Dropdown = function(el) { this.el = el; this.handle = el.find("div.dropdown-text"); this.options = el.find("div.dropdown-options"); this.optionsWrap = this.options.parent(); this.action = el.attr("action"); this.type = el.attr("type"); this.target = el.attr("target"); this.Init(); } Dropdown.prototype.Init = function() { var self = this; var extraPadding = 40; this.isShown = false; console.log(this); this.width = this.options.outerWidth() + extraPadding; this.height = this.options.outerHeight(); if (this.height > 300) { this.height = 300; this.options .height(300) .width(this.width + 12) .addClass("scroll-pane") .jScrollPane({ showArrows: true, scrollbarWidth: 9 }) this.width += 12; } else { this.options.width(this.options.width() + extraPadding); } var newWidth = (this.width < 220) ? this.width : 220; this.el.width(newWidth); this._AddShadow(); this.optionsWrap.css({ display: "none", visibility: "visible", width: this.width + 5, height: this.height + 5 }); this._SetEvents(); }; Dropdown.prototype.Toggle = function(force) { if (this.isShown && !force) { this.optionsWrap.hide(); this.isShown = false; } else if (!this.isShown && false !== force){ this.optionsWrap.show(); this.isShown = true; } } Dropdown.prototype._AddShadow = function() { var shadowWidth = 5, layer; for (var i = 0; i < shadowWidth; i++) { layer = $('<div class="shadow_layer"> </div>'); layer.css({ opacity: 0.055 * (i + 1), top: (shadowWidth - i), left: (shadowWidth - i), height: this.height, width: this.width }); this.optionsWrap.prepend(layer); } } Dropdown.prototype._SetEvents = function() { var self = this; this.el.bind('click', function(e) { var current = $(e.target); var type = current.attr("type"); if (current.hasClass('dropdown-text') || current.hasClass('dropdown-arrow')) { if (!self.isShown) { page.HideAllDropdowns(); } self.Toggle(); return false; } if (current.hasClass('dropdown-opt')) { switch (type) { case 'auto': case 'basic': var html = current.html(); self.handle.html(html); self.options.find('a.dropdown-opt').each(function() { $(this).removeClass('selected'); }); if ('auto' == type) { page.common.Update({ url: current.attr('path'), params: current.attr('params'), target: self.target, parent: true, method: "POST", handler: { handler: function(results) { var action = this.attr("action"); if (action) { page.events.Fire(action, this, results) }; }, context: current } }); } current.addClass('selected'); self.Toggle(); return false; case 'multi': current.toggleClass('selected'); break; case 'function': var html = current.html(); self.handle.html(html); current.Fire(); self.Toggle(false); break } } return false; }); } Hi I have developed an internet mapping site which uses an html viewer with various frames to pull in a mapping window, a legend / key and a frame of tools amongst other things. It works absolutely fine in Internet Explorer version 6, but whilst testing it in Internet Explorer 7, my mapping window is not loading up the image. It might seem strange me posting this in a javascript forum but as the error is javascript related I thought I would give it a shot! The error message I am receiving is "Access is denied". After looking online, it appears as though this error could be linked to the use of frames; and those frames trying to access other windows with different document domains?? Does anyone know if new security measures have been implemented in IE7 which restricts the use of frames? My code is below; does anyone notice anything that might give this kind of javascript error? Any help will be greatly appreciated as I do not tend to dable too much in javascript! Code: <META HTTP-EQUIV="Pragma" CONTENT="no-cache"> <meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1"> <TITLE>Intranet GIS Service</TITLE> <HTML> <HEAD> <SCRIPT LANGUAGE="JavaScript" SRC="javascript/aimsResource.js" TYPE="text/javascript"></SCRIPT> <SCRIPT TYPE="text/javascript" LANGUAGE="JavaScript"> // Designer will set the next variable - theTitle //var theTitle = "Intranet GIS"; var theTitle = ""; if (theTitle.indexOf("###TITLE##")!=-1) theTitle = titleList[0]; var cmdString = document.location.search; var webParams = cmdString; var reloadTimer=0; document.writeln("<TITLE>" + theTitle + "</TITLE>"); function doIt() { MapFrame.useJava=false; MapFrame.checkParams(); } function replacePlus(inText) { var re = /\+/g; inText = inText.replace(re," "); return inText; } function reloadApp() { //window.clearTimeout(reloadTimer); //reloadTimer = window.setTimeout("document.location.href = 'viewer.jsp' + cmdString",1000); //Above code replaced with this. Only the map should refresh after a resize, otherwise //all added datashare layers are lost. MapFrame.mWidth = MapFrame.getMapWidth(); MapFrame.mHeight = MapFrame.getMapHeight(); MapFrame.sWidth = screen.width; MapFrame.sHeight = screen.height; MapFrame.loadBannerLeft = parseInt((MapFrame.mWidth - 119)/2); MapFrame.loadBannerTop = parseInt((MapFrame.mHeight - 72)/2); MapFrame.document.getElementById("theMap").style.width = MapFrame.sWidth; MapFrame.document.getElementById("theMap").style.height = MapFrame.sWidth; MapFrame.iWidth = MapFrame.mWidth; MapFrame.iHeight = MapFrame.mHeight; MapFrame.legHeight = MapFrame.iHeight - 160; var cmd = 'MapFrame.sendMapXML();'; cmd += 'MapFrame.document.getElementById("theImage").style.width = MapFrame.mWidth;'; cmd += 'MapFrame.document.getElementById("theImage").style.height = MapFrame.mHeight;'; window.clearTimeout(reloadTimer); reloadTimer = window.setTimeout(cmd,1000); } </SCRIPT> </HEAD> <SCRIPT LANGUAGE="JavaScript" TYPE="text/javascript"> var browser = navigator.appName; var moreStuff = 'onresize="reloadApp()"'; var addNS = 0; if (browser=="Netscape") { addNS = 3; } document.writeln('<FRAMESET ROWS="' + (45+addNS) + ',*,30,0" FRAMEBORDER="No" FRAMESPACING="0" onload="doIt()" BORDER=2 ' + moreStuff + '>'); document.writeln('<FRAME NAME="TopFrame" SRC="topbar.htm" MARGINWIDTH="5" MARGINHEIGHT="0" SCROLLING="No" FRAMEBORDER="No" NORESIZE>'); document.writeln('<FRAMESET COLS="' + (30+addNS) + ',*,270" FRAMEBORDER="No" FRAMESPACING="0" BORDER="2">'); </SCRIPT> <FRAME NAME="TextFrame" SRC="text.htm" MARGINWIDTH="0" MARGINHEIGHT="0" SCROLLING="No" FRAMEBORDER="No" NORESIZE FRAMESPACING="0" BORDER="2"> <!-- If textframe is used--> <FRAMESET ROWS="*,115"> <FRAME NAME="MapFrame" SRC="MapFrame.htm" MARGINWIDTH="0" MARGINHEIGHT="0" SCROLLING="No" FRAMEBORDER="Yes" RESIZE="YES"> <FRAME NAME="ToolFrame" SRC="blank.htm" MARGINWIDTH="0" MARGINHEIGHT="0" SCROLLING="Auto" FRAMEBORDER="No" RESIZE="YES"> </FRAMESET> <!-- If textframe is not used --> <!--<FRAME NAME="MapFrame" SRC="MapFrame.htm" MARGINWIDTH="0" MARGINHEIGHT="0" SCROLLING="No" FRAMEBORDER="No" RESIZE="YES">--> <FRAME NAME="TOCFrame" SRC="TOCFrame.htm" MARGINWIDTH="0" MARGINHEIGHT="0" SCROLLING="Auto" FRAMEBORDER="No" RESIZE="YES"> </FRAMESET> <FRAMESET COLS="400,*" FRAMEBORDER="Yes" BORDER=2 FRAMESPACING="0"> <FRAME NAME="ModeFrame" SRC="bottom.htm" MARGINWIDTH="0" MARGINHEIGHT="0" SCROLLING="No" FRAMEBORDER="No" NORESIZE> <FRAME NAME="ModeFrame" SRC="bottom.htm" MARGINWIDTH="0" MARGINHEIGHT="0" SCROLLING="No" FRAMEBORDER="No" NORESIZE> </FRAMESET> <FRAME NAME="PostFrame" SRC="jsForm.htm" MARGINWIDTH="0" MARGINHEIGHT="0" SCROLLING="No" FRAMEBORDER="No" NORESIZE FRAMESPACING="0" BORDER="2"> </FRAMESET> <NOFRAMES> <BODY> <P> </BODY> </NOFRAMES> </HTML> Hello all, I'm trying to write a simple script in JS that will show a message for each day of the week. I have searched in your forums and other places but sadly I keep failing. Thank you for helping a newb. Code: <script type="JavaScript"> function showMessage() { var d = new Date(); var day = d.getDay(); // Note: Sunday=0, Monday=1, etc... switch( true ) } case ( day == 6 ) : { document.write("Today is saturday!") } case ( day == 5 ) : { document.write("Today is friday!") } case ( day == 4 ) : { document.write("Today is thursday!") } case ( day == 3 ) : { document.write("Today is wednesday!") } case ( day == 2 ) : { document.write("Today is tuesday!") } case ( day == 1 ) : { document.write("Today is monday!") } case ( day == 0 ) : { document.write("Today is sunday!") } } } </script> i have multiple customers in my company and i want to send an SMS to the mobile (cell phone) of the customer that he must pay the renewals fee's durng 2 weeks.. so i send to him an e-mail and at the same time i send for him an SMS message to his phone to ensure that he will read the message that he must pay the fee's. i dont know if there is a module that can make this idea or i must buy a product or register into a website to make this module... thnx alot I was wondering if there was an easy way to configure a message box to resemble that of a login form. It would preferably have two text fields for username/password and OK and Cancel buttons as well. I currently have a normal login form on my website designed using PHP but it does not figure into what we need to do now. I'm not sure about going about this and I have tried looking for quite sometime for an example of this but cannot find one.
Hi all new guy on the block here, I've got a website, and I want to add a welcoming message which hovers on a certain part of the page which only loads for the visitor for the first time they login, and won't again(presumably cookies used). And says something like "adjust your settings here.." I don't want it to be an external popup but something that loads on the page in a certain area, defined by me (PX-pixle reference) I think i nutted something out in a bit of PHP, this is what i've got so far PHP Code: <?php if (firstLogin()){ genSpecial(***load jquerie or css etc***); } else{ genRegular(); } ?> can anyone help me figure out how to make this all work and load a box from jquerie or something similar? thanks David Hi there, I am trying to add something from a textbox within a prompt message into a listbox. When I press the "Add" button, a prompt message will pop up. I will check if the textbox is empty. If it is empty and I press okay, it will show an alert message stating "Empty insert. Please enter something into the textbox." And if I press cancel, it will show alert message "You have pressed cancel." If it is not empty, and I press okay, it will insert the data into the listbox successfully. If I press cancel, it will show alert message "You have pressed cancel." Below are my codes. Javascript Code: function addOption() { var newItem = prompt("Enter New Item"); if (!newItem == "") { var answer = confirm ("Are you sure you want to add? ") if (answer)//if answer is true { var lstBx = document.getElementById("lstBxEmail"); // Now we need to create a new 'option' tag to add to MyListbox var newOption = document.createElement("option"); newOption.value = newItem; // The value that this option will have newOption.innerHTML = newItem; // The displayed text inside of the <option> tags // Finally, add the new option to the listbox lstBx.appendChild(newOption); //sort items in listbox in alpha order arrTexts = new Array(); for(i=0; i<lstBx.length; i++) { arrTexts[i] = lstBx.options[i].text; } arrTexts.sort(); for(i=0; i<lstBx.length; i++) { lstBx.options[i].text = arrTexts[i]; lstBx.options[i].value = arrTexts[i]; } } else { if(newItem) { alert("Key something to textbox please."); } else alert("Cancel choice."); } } } HTML Code: <center><input id="Submit18" type="submit" value="Add Address" onclick="addOption()"/> <div>Address:</div> <center> <select id="lstBxEmail" name="listBoxEmail" multiple="multiple" style="width: 580px;"> <option>Java</option> <option>PHP</option> <option>Perl</option> <option>Javascript</option> <option>C#</option> <option>Powershell</option> </select> </center> im trying to display a random number, but each time a button is pressed that calls the test function, i don't want to random number to be repeated. i know i have to declare 2 variables and a while loop, but i'm stuck as to what to put in the second variable and in the while loop. any advice is appreciated var random = Math.floor(Q * Math.random()); var random2 = ?? function test () { document.write(random); while (random == random2) { document.write(random); } } Hee guys, I've got a little bit of a problem on my hand. Someone has asked me to help them on a FREE forum host. You have no access to PHP or SQL or anything like that. Just the templates, but even those are really messy! Now on the navagation bar there a PM section (obviously) but the wording they have used is very long and ugly. I was wondering if it would be possible to change the wording whilst still having it show the amount of PM's that you have. If you need anymore information just ask, but I really hope someone can help okay. I am in the process of learning javascript and I've been looking at this code for the longest time ever. So far I got most of it done. but the problem is for example I leave all the required fields empty, it gives me the alert message of the first field and not the alert messages of all the others. What I want to know is how can you go through and check the whole form first before submitting and then when there is any error on any field, shows just one alert message containing all the error messages. code for the form Code: <form action="mailto:hummdedum@felloff.com" method="post" name="form" onSubmit="return isFormValid();"> * First Name: <input type="text" name="FName" id="FName" onblur="checkFName();"/><label id="labelFName"></label><br /> * Last Name: <input type="text" name="LName" id="LName"onblur="checkLName();"/><label id="labelLName"></label><br /> * Password: <input type="password" id="pw" name="Password" onblur="checkpw();" id="pw"/><label id="labelpw"></label><br /> *Re-type Password: <input type="password" name="2Password" id="pw2" onblur="checkpw2();" /><label id="labelpw2"></label><br /> I am a: <br /> <input type="radio" name="status" value="fresh" /> Freshman<br /> <input type="radio" name="status" value="soph" /> Sophomore<br /> <input type="radio" name="status" value="jr" /> Junior<br /> <input type="radio" name="status" value="sr" /> Senior<br /> I am taking classes in the: <br /> <input type="checkbox" name="semester" value="fall" /> fall time<br /> <input type="checkbox" name="semester" value="spring" /> Spring time <br /> My favorite element is: <select name="element" id="element"> <option value="">select one</option> <option value="fire">Fire</option> <option value="earth">Earth</option> <option value="water">Water</option> <option value="air">Air</option> </select><br /> *Birthday: <input type="text" id="BDay" name="Birthday" onblur="checkBDay();"/><label id="labelBDay"></label><br /> *E-Mail: <input type="text" id="email" name="Email" onblur="checkEmail();"/><label id="labelEmail"></label><br /> <input type="submit" value="Submit" /> <input type="reset" value="Clear" /> </form> code for the javascript Code: function isFormValid() {var userF = document.getElementById('FName').value; var userL = document.getElementById('LName').value; var userPW = document.getElementById('pw').value; var userPW2 = document.getElementById('pw2').value; var userBDay = document.getElementById('BDay').value; var userEmail = document.getElementById('email').value; var NameFormat = /^[A-Za-z]{2,12}$/; var PWFormat = /^[A-Za-z0-9{6,12}$]/; if (!NameFormat.test(userF)) { alert("First Name is required and should only have letters. 2-12 letters max"); return false; } if (!NameFormat.test(userL)) { alert("Last Name is required and should only have letters. 2-12 letters max"); return false; } if (!PWFormat.test(userPW)) { alert("Password is required and should only have letters and numbers. 6-12 letters max"); return false; } if (userPW != userPW2) { alert("Passwords do not match."); return false; } } function checkFName() { var userF = document.getElementById('FName').value; var elementF = document.getElementById('labelFName'); var NameFormat = /^[A-Za-z]{2,12}$/; if (!NameFormat.test(userF)) { elementF.innerHTML = "First Name is required and should only have letters. 2-12 letters max"; elementF.style.color = "red"; } else { elementF.innerHTML = ""; elementF.style.color = "green"; } } function checkLName() { var userL = document.getElementById('LName').value; var elementL = document.getElementById('labelLName'); var NameFormat = /^[A-Za-z]{2,12}$/; if (!NameFormat.test(userL)) { elementL.innerHTML = "Last Name is required and should only have letters. 2-12 letters max"; elementL.style.color = "red"; } else { elementL.innerHTML = ""; elementL.style.color = "green"; } } function checkpw() { var userPW = document.getElementById('pw').value; var elementPW = document.getElementById('labelpw'); var PWFormat = /^[A-z0-9]{6,12}$/; if (!PWFormat.test(userPW)) { elementPW.innerHTML = "Password is required and should only have letters and numbers. 6-12 letters max"; elementPW.style.color = "red"; } else { elementPW.innerHTML = "Valid Password"; elementPW.style.color = "green"; } } function checkpw2() { var userPW2 = document.getElementById('pw2').value; var userPW = document.getElementById('pw').value; var elementPW2 = document.getElementById('labelpw2'); if (userPW != userPW2) { elementPW2.innerHTML = "Passwords do not match."; elementPW2.style.color = "red"; } else { elementPW2.innerHTML = "Passwords Match"; elementPW2.style.color = "green"; } } I want to also validate birthday.. and I tried using regular expression with leap years but the expression is too hard for me to think of. so I am gonna try using split() but I dont noe... and for the clear button. since I blur functions, how would I just clear all the blur statements = like a restart of the form and then when the user enters the field the blur function still works? thanks -pumpkin |