Populate an Array via Anchors/HyperLinks - JavaScript Help




How would I go about populating an array through anchors ()

I have several links that contain people names, and I want to put these into an array upon the user clicking them. The data inside the array will not always be the same, it all depends on what names the user clicks on.

If you require more information, please let me know!

Cheers ;)
Posted On: Wednesday 2nd of January 2013 12:40:59 AM Total Views:  320
View Complete with Replies

RELATED TOPICS OF JavaScript PROGRAMMING LANGUAGE




phatfusion image menu don't working

Hi all, I added phatfusion image menu to my oscommerce site but don't working. say why I dont know. I did everything right, but not. I transfered imageMenu.js and imageMenu.css to public_html, I transfered mootols.js to /_common/js/ Then, I added those to index.php; Finally I added that code to header.php; Landscapes People Nature Urban Abstract window.addEvent('domready', function(){ var myMenu = new ImageMenu($$('#imageMenu a'),{openWidth:310, border:2, onOpen:function(e,i){alert(e);}}); }); but don't working. this site: http://www.matbaaoffice.com What can I do
VIEWS ON THIS POST

123

Posted on:

Monday 19th November 2012
View Replies!

Simple Java Script Question

Hi , I am trying to hide 2 list boxes, then on selection changed show a new list box with JavaScript, i am very very new to web development in general, I am actually a software developer in the Pascal and C# language so this is all very new to me, please help with any ideas or code This is what i have NCS Quote System I am aware of the fact that there is no Java Script in there yet because i have no idea how to go about this ...
VIEWS ON THIS POST

89

Posted on:

Monday 19th November 2012
View Replies!

Questions about TextArea

, i want to ask that is there anyway to display the text in textarea with proper format like "setw" in C++ \t I try to use label before and it works if i do some html code inside, but i have several hundreds even thousands of lines to be display and if i use label with html tags, it would be very slow in displaying the results. Advice needed
VIEWS ON THIS POST

256

Posted on:

Wednesday 21st November 2012
View Replies!

need help testing a script in IE

Im currently updating my Event handling library and due to not having an IE to test (Im on a unix machine) I require your help. I want to know is whether the current setup works: test case 1 there should come up 4 alerts numbered from 1 to 4. I already tested it in FF (uncommenting the DOM-2-Events) but, well, I still need to know if it works in IE too. PS. does anyone know how to detach that: obj.attachEvent('on' + evType, IEHandler.bind(obj)); regards Dormi
VIEWS ON THIS POST

171

Posted on:

Wednesday 21st November 2012
View Replies!

Why navigator.appCodeName returning Mozilla?

I have this program that should tell me browser details but navigator.appCodeName is showing Mozilla on IE, Safari, Opera, Chrome, and FireFox. Can any one tell me why Javascript Example 1 function detectBrowser(){ (document.getElementById("appCode")).innerHTML = navigator.appCodeName; (document.getElementById("appName")).innerHTML = navigator.appName; (document.getElementById("appVersion")).innerHTML = navigator.appVersion; (document.getElementById("userAgent")).innerHTML = navigator.userAgent; (document.getElementById("platForm")).innerHTML = navigator.platform; } Application Code: Application Name: Application Version: User Agent: Platform:
VIEWS ON THIS POST

111

Posted on:

Wednesday 21st November 2012
View Replies!

JavaScript help

How do I write a program such that if an HTML button is pressed, ask the user for a number, and if the number is 255, display the text white using an alert() call. If the number is 0, display the text "black" using an alert(...) call. Otherwise, display the text nice colour using an alert() call. Can someone help me
VIEWS ON THIS POST

122

Posted on:

Wednesday 21st November 2012
View Replies!

Ext JS by Sencha

I was looking at using the Ext JS 4.1 (http://www.sencha.com/products/extjs/) , it promisses to enable developers to use the model-view-controller (MVC) architecture when building their app. can someone give me an example of how I can use the Ext JS 4 with MVC if I wanted to create a form using their code, it looks like I need to write a specific form code in JS for each form (with every element I want the form to have) I need, how is that MVC I'd like an option to build a form using PHP (to retreive data like- name fields and field type, etc..) to make my JS create that form on it's own, by getting data from php.. I expected to see some sort of generic functions with params.. what am I missing
VIEWS ON THIS POST

91

Posted on:

Saturday 24th November 2012
View Replies!

Trying to add JS to eatery menu

I have this form, and I want to add JS to it. I got part of it. But the hard part is the ordering menu part it's self. Can someone help me please item price quantity sub-total Hamberger
VIEWS ON THIS POST

110

Posted on:

Saturday 24th November 2012
View Replies!

Javascript , ajax clock not working properly in Chrome

hi.. i used this code to display a clock. var int=self.setInterval("clock()",1000); function clock() { var d=new Date(); var t=d.toLocaleTimeString(); document.getElementById("apDiv1").innerHTML=t; } in firefox it displays like this 7:25:00 PM and in Chrome 19:25:39 i want to show a similar clock as in firefox in Chrome. How can i change it, function clickCheck(obj,rbselfcollection) { if (rbselfcollection.checked) { } else alert("First CheckSelf-Collection by User at"); } i am using onmousedown="clickCheck(rbself1,rbselfcollection) in the calling radiobutton tag. This code is working fine in IE.....how can i change it to Firefox Browser can any one pls assist
VIEWS ON THIS POST

126

Posted on:

Saturday 24th November 2012
View Replies!

dropdown value remains --select-- although it has?

I have a dropdown present in a div and i am displaying that div in a floatbox on the click of a checkbox using javascript. My problem is that the value of the dropdown that i am selecting is stored in a hiddenfield before closing the floatbox. But when i open that floatbox again i have set the dropdown value as it is in the hiddenfield.After checking the value that has been set in dropdown in running mode it showing me the correct value but it is displaying the --select-- value only. this is happening only in mozilla and chrome browser and not in IE. PLZ HELP ASAP,
VIEWS ON THIS POST

120

Posted on:

Saturday 24th November 2012
View Replies!

Scrollbar help?

I need serious help with Scrollbars. how can i position them so they go exactly where i need them. say on a picture i need it in the circle area how can i get it there and what do i need to do Could somebody point me in the right direction or towards a tutorial
VIEWS ON THIS POST

169

Posted on:

Saturday 24th November 2012
View Replies!

jQuery and Authentication

I am trying to create a web-based Twitter app that will print out a friend's timeline, but the Twitter API asks for username/password. How do I do the username/password authentication on the server-side without asking this from the user. Does anyone know how to do this Is there also a way to create a dynamic app that will update inside the web page whenever a new twitter update occurs Here is the code: $(document).ready(function(){ $('#response').createAppend('img', { src: 'images/twitter-32x32.png', alt: 'Loading...', id: 'loading_image'}, null); $.getJSON(url, ws_results); }); function ws_results(obj) { // hide the loading image $('#loading_image').hide("slow"); // alternative way of displaying properties // var property, propCollection = ""; // for (property in obj[0].user) { // propCollection += property + "\n"; // } // alert(propCollection); $('#response').createAppend( 'table', { width: '600px', align:'center', border:'2', rules:'none', frame:'box', style: 'background:#FFF;' , Name: 'tableData', id: 'Tweets' }, [ 'tr', { }, [ 'th', { colspan: '2', align: 'left', style: 'background: #FFF; color: #000 ' }, [ 'img', { src: 'images/twitter-logo.jpg', align: 'left'} ] ] ] ); // loop through items for (var i = 0; i < obj.length; i++) { // create table row $('#Tweets').append(''); $('#row' + i).append(''); $('#row' + i).append(''); if (typeof(obj[i].user.url) == "undefined" || obj[i].user.url == '') { $('#lcell' + i).createAppend('img', { src: obj[i].user.profile_image_url, Name: 'ProfileImg', align: 'left', hspace: '5', alt: obj[i].user.name }, null); } else { $('#lcell' + i).createAppend('a', { href: obj[i].user.url }, [ 'img', { src: obj[i].user.profile_image_url, Name: 'ProfileImg', align: 'left', hspace: '5', alt: obj[i].user.name }, null]); } $('#rcell' + i).createAppend('a', { id: 'Twit', title: obj[i].user.name, href: 'http://twitter.com/' + obj[i].user.screen_name }, obj[i].user.screen_name ); $('#rcell' + i).append(' ' + obj[i].text + ' '); $('#rcell' + i).append('' + obj[i].created_at + ''); $('#rcell' + i).append(' from ' + obj[i].source); } } //]]>
VIEWS ON THIS POST

55

Posted on:

Saturday 24th November 2012
View Replies!

Opening a Template in NVU to edit

Im working in web designing module. My one of the html file has several template samples as well as a link like "Edit this Template". When i click this link, that corresponding template should open with the designing software such as dreamweaver, NVU etc.,( In my case im using NVU) i.e., that selected template should open with NVU application to edit.. How is this possible.. Im blank. Please give me some ideas or sample codes or reference URL'S.... Thank You in advance...
VIEWS ON THIS POST

146

Posted on:

Saturday 24th November 2012
View Replies!

a weird Javascript error

A piece of JavaScript on one of our pages gives an access denied error. In itself nothing strange, it's a reasonably well defined error after all :) What is strange is that the error ONLY happens on that page (despite identical calls to the JavaScript function appearing on several other pages) and that the error ONLY appears if the page is loaded in a fresh browser instance. If I reload the page before executing the script (which is triggered in the onblur event of a formfield) the error does not appear and the script is executed successfully. The function of this script is to download some data from the application server and pipe that data into an HTML element (in this case a td, in other pages it may be a div). Can anyone shed some light as to where to look for the cause of this Here's the relevant JavaScript and HTML (fragments of course): var myFrames = new Array(); function frameObj(index) { this.busy = true; this.index = index; obj = document.createElement("iframe"); obj.style.height = "0px"; obj.style.width = "0px"; this.frame = document.body.appendChild(obj); if (this.frame.contentWindow) this.frameDoc = obj.contentWindow.document; else if (this.frame.contentDocument) this.frameDoc = obj.contentDocument; else this.frameDoc = null; } function findFrame() { for (i = 0; i < myFrames.length; i++) { if (!myFrames[i].busy) { myFrames[i].busy = true; break; } } if (i >= myFrames.length) myFrames[i] = new frameObj(i); return myFrames[i]; } function getHTML2(oElement, form, data) { dataElement = oElement; if (!(frame = findFrame())) return; if (frame.frameDoc) { elms = form.elements; doc = frame.frameDoc; doc.open(); doc.write(""); doc.write(""); doc.write(""); for (i = 0; i < elms.length; i++) { elm = elms[i]; switch (elm.type) { case 'button': case 'file': case 'reset': case 'submit': continue; case 'checkbox': if (elm.checked == false) continue; case 'radio': if (elm.value == '') continue; } doc.write(""); } doc.write(""); doc.close(); doc.forms["send"].submit(); } } function getHTMLDone2(ind, result) { dataElement.innerHTML = result; dataElement.setAttribute('hasContent',true); elementInitTabctls(dataElement); elementTablesInit(dataElement); myFrames[ind].busy = false; } Code is part of a JSP, JSP code resolves correctly. function getOnEnter() { if (window.event.keyCode == 13 ) { window.event.returnValue = false; getHTML2(ss, pageform, 'ss'); } } function aktieOnEnter(arg) { if (window.event.keyCode == 13) { window.event.returnValue = false; faktie(arg); } } function faktie(arg) { document.pageform.uaktie.value = arg; document.pageform.submit(); } Naam Wachtwoord Server  
VIEWS ON THIS POST

207

Posted on:

Saturday 24th November 2012
View Replies!

Newsletter

I have a Newsletter, with a "Forward to a Friend" link, this link is to a form that takes names and email addresses of 5 friends and has a Send Email button. How can I implement the Send Email part, as of now I just have the form.
VIEWS ON THIS POST

72

Posted on:

Sunday 25th November 2012
View Replies!

is this possible?

I am building a website that's worked out very nicely so far with few problems. It's mainly coded in php and xhtml with css. This site also uses 1 inline frame. I don't know much about javascript - it seems to be such an immense scripting language to me, but what I do know is that it's useful for things like what I'm trying to do - specifically refreshing/reloading pages. I found a snippet of javascript that works very well provided that it's only one child and one parent, but now I'm running into a problem. On the main site (parent page) there is a link to register. This results in a pop up window - done by javascript. This popup window contains the terms of registering to the site, and if the user agrees to the terms he/she clicks a button which will take the user to a registration form in the same popup, via a form submit button. After he/she registers and clicks on the submit button for the registration page, the popup window will then load a third page which processes user data, does checks against the database, etc etc, and if successful the user will then have a limited account for the site. My problem is trying to refresh the original parent (main site) page that executed the original popup, so that the links will update. When a user logs into the site, he/she is prompted to enter their information into an inline frame in the parent site, and the javascript snippet that I have will refresh the parent page just fine. When I use this same snippet or any of the other thousands of snippets out there on the web, it seems to refresh either the first popup window that contains the terms, or it will refresh the popup window that contains the registration process, which will result in an error saying the user is already logged in. What I would like to do is have the user click a continue button after reading the "Welcome to the site blah blah blah" /process registration page after user registration is successful and completed, which will close the popup window and refresh the original parent window. Does anyone know what I should look into for this, or can point me in the right direction Site map is like: parent page | V popup1(terms) > popup1(register form) > popup1 (process data/welcome message) popup1(process data...etc) should refresh the parent page the snippet I'm using is: function checkit() { myvar = location.search.substr(1); if (myvar=="b"){ } else{ setTimeout("window.parent.location.href = window.parent.location.href+'b'",3000);} } window.onload=checkit;
VIEWS ON THIS POST

100

Posted on:

Monday 26th November 2012
View Replies!

Papulated One Text Filed Values Into Another Text Filed Values - JavaScript Help

Hi to all, \tIn my registration page, i have a headers like Company Information, Contact Information and etc. Fields in company information : Company Name, Address1, Address2, City, Country, State, ZipCode Fields in Contact Information : First Name, Middle Name, Last Name, Email Address, Phone, Address1, Address2, City, Country, State, ZipCode. Country and State are two dropdowns and depending upon the selected country name the states will be appear. Am fetching the values from javascript instead of mysql database.\t(http://bdhacker.sour...ript/countries/) I have a checkboxes Whether the Contact address is as same as the company address with "Yes" or "No". When User cheks the "Yes" checkbox, then the Company Address text Filed values will be papulated in the respective Contact Information textbox fileds. If he cheks "No" checkbox, the Contact information fields will be validated. Please suggest me how can i solve my problem.
VIEWS ON THIS POST

104

Posted on:

Tuesday 27th November 2012
View Replies!

How to simultaneously animate two divs in Jquery - JavaScript Help

Hi ,here is an example of what I want to do: http://cam-it.com/test.htmlBut here is what happens when I try to do that with two divs\thttp://cam-it.com/test2.htmlWhy is this happening\t here is the code for the first body { background-color:#000000; } #square{ width:356px; height:52px; border: 1px solid red; background-image:url(images/ANIMATEINS.png); background-repeat:no-repeat; position:relative; } #container{ margin:100px auto; width:356px; height:52px; background-image:url(images/ANIMATE.png); background-repeat:no-repeat; position:relative; border:1px solid blue; } #square2{ width:356px; height:52px; border: 1px solid red; background-image:url(images/ANIMATEINS.png); background-repeat:no-repeat; position:relative; } #container2{ margin:100px auto; width:356px; height:52px; background-image:url(images/ANIMATE.png); background-repeat:no-repeat; position:relative; border:1px solid blue; } #box { border: 1px solid #FF0000; } var $square = $("#square"); bounce(); function bounce() { $square.animate({ left: "+=170" }, 1000, function() { /**new command**/ $square.animate({ left: "-=170" }, 1000, function() { bounce(); }) /**end command**/ }); } And here is the code for the second: body { background-color:#000000; } #square{ width:356px; height:52px; border: 1px solid red; background-image:url(images/ANIMATEINS.png); background-repeat:no-repeat; position:relative; } #container{ margin:100px auto; width:356px; height:52px; background-image:url(images/ANIMATE.png); background-repeat:no-repeat; position:relative; border:1px solid blue; } #square2{ width:356px; height:52px; border: 1px solid red; background-image:url(images/ANIMATEINS.png); background-repeat:no-repeat; position:relative; } #container2{ margin:100px auto; width:356px; height:52px; background-image:url(images/ANIMATE.png); background-repeat:no-repeat; position:relative; border:1px solid blue; } #box { border: 1px solid #FF0000; } var $square = $("#square"); bounce(); function bounce() { $square.animate({ left: "+=170" }, 1000, function() { /**new command**/ $square.animate({ left: "-=170" }, 1000, function() { bounce(); }) /**end command**/ }); } var $square2 = $("#square2"); bounce(); function bounce() { $square2.animate({ left: "+=170" }, 1000, function() { /**new command**/ $square2.animate({ left: "-=170" }, 1000, function() { bounce(); }) /**end command**/ }); }
VIEWS ON THIS POST

180

Posted on:

Tuesday 27th November 2012
View Replies!

Calling Web Services from independent browser using javascript

, I'm trying to call some web services only using javascript from a html page. I succeeded on doind this in IE with the use of the behavior:url(webservice.htc); (technique founded in the microsft site) but when i'm going to try ...
VIEWS ON THIS POST

168

Posted on:

Friday 30th November 2012
View Replies!

window.open - trying to display a new window with a different title - HELP

I need to open a new window from an existing HTML page to a site in which we do not want to show the address for. I have set the titlebar to no but it will still place the title ...
VIEWS ON THIS POST

130

Posted on:

Friday 30th November 2012
View Replies!

The Round-Trip Time of an XMLHTTP Call?

Hi. Can somebody tell me how to tell how long the round trip will take from client to server and back of an xmlhttp call I want to gauge how long the server code is going to crunch and return ...
VIEWS ON THIS POST

115

Posted on:

Friday 30th November 2012
View Replies!

SkimpyGimpy PNG canvas w/ Javascript mouse tracking

ANN: SkimpyGimpy PNG canvas has Javascript mouse tracking The SkimpyGimpy PNG image canvas now can generate Javascript data structures which allow HTML pages to intelligently respond to mouse events over the image. Please read about the SkimpyGimpy Canvas and look ...
VIEWS ON THIS POST

283

Posted on:

Friday 30th November 2012
View Replies!

how do they hide their html?

http://allwebco-templates.com/templa.../T22dmGolf.htm...
VIEWS ON THIS POST

85

Posted on:

Friday 30th November 2012
View Replies!

passing subarrays (by reference)?

hi, let say i have the following array : var ary = [ [ 'Directory', 'type', 'href', 'tip', ['file', 'type', 'href', 'filetip' ], ['file2', 'type2', 'href', 'filetip' ], ], [ 'Dir2', 'href2', 'tipdir2' ] ] I want to send to ...
VIEWS ON THIS POST

86

Posted on:

Friday 30th November 2012
View Replies!

Amazing Javascript SQL database (jsSQLdb) in the browser!!!

Javascript site where you create dynamic web pages in seconds with menus, trees, galleries and more, with simple SQL statements. Webpages are stored as SQL tables and all access to the tables and creation of page objects only use SQL ...
VIEWS ON THIS POST

88

Posted on:

Friday 30th November 2012
View Replies!

jscript function call in c# application

I wrote a little application in c# and included the vsa i have a gui which allows dynamic scripting either of jscript or of vbscript. if i want to execute the written vbscript functions after initializing the engine i ...
VIEWS ON THIS POST

134

Posted on:

Friday 30th November 2012
View Replies!

How to a JSP application interoperate with a .NET class library

I am developing a class library under Visual C++ .NET. I found out yesterday that a client developing a website to use it is writing JSP pages running on an Apache server on a Windows box. Neither of us knows ...
VIEWS ON THIS POST

119

Posted on:

Friday 30th November 2012
View Replies!

Try on security update from the Microsoft Corporation

...
VIEWS ON THIS POST

92

Posted on:

Friday 30th November 2012
View Replies!

Ubound Error: not defined

I know this can be done, what am I doing wrong If you have form objects on a page with the same name they are automatically put into an array This is what Im trying to accomplish since I do ...
VIEWS ON THIS POST

95

Posted on:

Friday 30th November 2012
View Replies!

Ext JS charts

I'm trying to figure out how to implement one of the charts from the Ext JS framework.. where I get stuck is- I can't find the code that has the data inside the chart. like on exis x- Hits per Month and exis y- month, where is the code that says Jun-40, Jul -79, ect.. if there's a tutorial for using those charts (any kind of chart, just to get the idea) I'd appreciate it.
VIEWS ON THIS POST

108

Posted on:

Sunday 23rd December 2012
View Replies!

How to make page title, auto refresh every x seconds (using javascript

I have a php file lets say file1.php, that printing a variable, its dynamic numbers output that already always increasing, like private message numbers that coming or others : i want to put that variable output, in another files page title, lets say file2.php or file3.html, in the front of the another files page titles, and auto refresh every x seconds, maybe like this : Quote(1) - another text in the page title
VIEWS ON THIS POST

102

Posted on:

Sunday 23rd December 2012
View Replies!

Validation while keypress

i was wandering on how to start the validation in my registration form a validation that wont need to be refreshed that if i fill up a username and entered a invalid keywords the word "You have entered a invalid keyword" will automatically shows up on the right or left or below of that input box.. anyone who can give a code sample about it or help any help would be appreciated ..
VIEWS ON THIS POST

99

Posted on:

Sunday 23rd December 2012
View Replies!

changing textbox text color onclick

i have a textbox thats initial text color is set to grey, i want to change the text color to black when the user clicks on it, is this done by using onclick="style=color:Black;" i have tried this and failed but maybe ive got something slightly wrong or is it done a different way completely. any help would be greatly appreciated.
VIEWS ON THIS POST

66

Posted on:

Sunday 23rd December 2012
View Replies!

replace characters

i am transferring data from one form to another by passing the data into the url, but when i place on the next form it shows up with + signs from the url aswell i have a piece of code in there that should be replacing it with just a space but it doesnt seem to be working, any advice here is my code: function getValue(varname) { \tvar url = window.location.href; \tvar qparts = url.split(""); \tif (qparts.length == 0) \t{ \t\treturn ""; \t} var query = qparts[1]; \tvar vars = query.split("&"); \tvar value = ""; \tfor (i=0;i
VIEWS ON THIS POST

85

Posted on:

Sunday 23rd December 2012
View Replies!

Fields inside Javascript not passing to PHP form submit

I have a multi-page form which will (once it is functional and prettied up) be added to our site to allow prospective students to calculate their estimated cost of attending. Everything works beautifully except the Room and Board area. The code:
VIEWS ON THIS POST

104

Posted on:

Sunday 23rd December 2012
View Replies!

jQuery minor help.

, I am currently working on my website, making a beta version. I've been stumped by what should be a small problem... If any! I've got a comment system, and if you're admin, it places a link under the comment, reading "delete comment", the actual link is; delete comment Now, I'll paste the function. function removeComment(t,id) { //AJAX TO REMOVE COMMENT var str = "#comment_" + id; $(str).fadeOut(); } Now.. That doesn't work. Where it reads "#comment_+id" that's a span tag which holds the comment. But, if I use; function removeComment(t,id) { //AJAX TO REMOVE COMMENT var str = "#comment_" + id; $(t).text("Removed"); } The link actually changes to "Removed", but the comment wont budge.. So, in all. The display is like so; [code] huzi8t9 wrote This is my comment - delete comment Any ideas Any help is appreciated!
VIEWS ON THIS POST

114

Posted on:

Monday 24th December 2012
View Replies!

Lightbox not displaying correctly in IE, works perfectly in FF

, I'm working on making a simple-as-possible lightbox using CSS + JS. When you click the link a bordered box pops up and the page "fades to black". In FF the black layer (which makes it look as if the rest of the page is darkened, like the "Lights Off" feature Hulu has) fades in and out properly and the box displays as the correct size. In IE 6 and 7 this is not the case (not tested with IE 8), the lightbox just appears, the black layer is not even present. Here is my code, maybe someone can give me a hand .black_overlay{ display: none; position: absolute; top: 0%; left: 0%; width: 300%; height: 300%; background-color: #000000; z-index:1001; -moz-opacity: 0.8; opacity: .8; filter:alpha(opacity=80); } .white_content { display: none; position: absolute; top: 25%; left: 25%; width: 50%; height: 50%; padding: 16px; border: 16px solid #3f3f3f; background-color: white; z-index:1002; overflow: auto; } function resetOp() { document.getElementById('dark').style.opacity = 0.0; document.getElementById('dark').style.MozOpacity = 0.0; document.getElementById('dark').style.filters = "alpha(opacity=0)"; } function fadein(alphaWhole) { var d = document.getElementById('dark'); if (alphaWhole == null) { alphaWhole = 0; } if (alphaWhole < 85) { d.style.opacity = alphaWhole/100; d.style.MozOpacity = alphaWhole/100; d.style.filters = "alpha(opacity=" + alphaWhole + ")"; alphaWhole += 5; window.setTimeout("fadein(" + alphaWhole + ")", 10); } else { alphaWhole = 80 } } function fadeout(alphaA) { var d = document.getElementById('dark'); var l = document.getElementById('light'); if (alphaA == null) { alphaA = 80; } if (alphaA === 0) { d.style.display='none'; l.style.display='none'; } else { d.style.opacity = alphaA/100; d.style.MozOpacity = alphaA/100; d.style.filters = "alpha(opacity=" + alphaA + ")"; alphaA -= 5; window.setTimeout("fadeout(" + alphaA + ")", 10); } } function toggleLightbox() { var d = document.getElementById('dark'); var l = document.getElementById('light'); if (d.style.display != 'block' && l.style.display != 'block') { resetOp(); d.style.display='block'; l.style.display='block'; fadein(); } else { fadeout(); } } Show Lightbox Lightbox here Close
VIEWS ON THIS POST

87

Posted on:

Monday 24th December 2012
View Replies!

Dynamic form with Javascript

I'm trying to put together an expandable (and shrinkable, but that is less important) form using Javascript. I haven't really used Javascript before so I'm going at this with very little experience and I really just want some pointers towards the functions I might need. The basic layout is that I have a text input box, with a + button after it, which will add a second input box with a unique ID. Something similar to what G-mail does with attachements when you're composing a message. My understanding is that I will need to use tags to indicate to the Javascript which bits of the page need to be edited, but I'm not really sure how you use Javascript to change the contents of a tag. The only useful thing I've found is on W3Schools, which does this: document.getElementById('txt').innerHTML=h+":"+m+":"+s But this code replaces the whole of the content of the tag, and I can't figure out if I can change this to just edit the content, or whether I need a completely different method.
VIEWS ON THIS POST

79

Posted on:

Monday 24th December 2012
View Replies!

Problem with validating a simple form! - JavaScript Help

I'm very new to JS and trying to learn. Currently I'm trying to make a form validation for my website. What happends in the code below is that when you select an option from a drop down select field, it creates a new list item inside a ul list. I got everything to work except one thing. How many list items you can create. I simply want to restrict the user from selecting more than 3 options from the drop down menu. If you select a 4th option an alert message should pop up but I can't get it to work..Here's the JS code:function selectGenres(select){ var option = select.options[select.selectedIndex]; var ul = select.parentNode.getElementsByTagName('ul')[0]; var choices = ul.getElementsByTagName('input'); for (var i = 0; i < choices.length; i++) if (choices[i].value == option.value) { alert("The genre is already selected!"); return false; } else if (option == 3) { alert("You can only select 3 genres!"); return false; } var li = document.createElement('li'); var input = document.createElement('input'); var text = document.createTextNode(option.firstChild.data); input.type = 'hidden'; input.name = 'ingredients[]'; input.value = option.value; li.appendChild(input); li.appendChild(text); li.setAttribute('onclick', 'this.parentNode.removeChild(this);'); ul.appendChild(li); }And here is the form to validate: Genre... Animation Action Adventure Animals Comedy ...
VIEWS ON THIS POST

54

Posted on:

Friday 28th December 2012
View Replies!

importing js inside a js file - JavaScript Help

hey im wondering who to import a js file insdie another js file...for instance if i wanted to load function function from the library into a js file to execute them...if someone has any good ways/ideas/tips please
VIEWS ON THIS POST

52

Posted on:

Friday 28th December 2012
View Replies!

simple jquery conditional response-to-comment form display - JavaScript Help

I am looking to compare the data-commentid attribute process in javascript after user slideToglle function. I want to compare that value attribute in each interaction with $id variable within the php. if $id = commentid data attribute in the span tag then display the response. I am not sure whether to do the comparison in php or javascript. an example or idea is if(after slideToggle, write a response, submit the form with the response then compare $id == $idc) that would be the sequence. if $id == $idc then display the response and only then.Any idea code I have so far is as below. ' . $ufirstname . ' • ' . $message_date . ' hi how you doing today id=101
VIEWS ON THIS POST

152

Posted on:

Friday 28th December 2012
View Replies!

won't stop executing - JavaScript Help

ive got this code: $(document).ready(function() { var number = 5; function countdown() { setTimeout(countdown, 1000); $('#box').html("Selecting person in " + number + " seconds"); number --; if (number
VIEWS ON THIS POST

125

Posted on:

Friday 28th December 2012
View Replies!

In form need to add a checkbox with javascript to enctype="multipart/form-data" - JavaScript Help

I hope I am in the right forum because my php code is on another page. Because my form has to uplaod pictures it is set to method post., and enctype="multipart/form-data". Now my checkbox button does not work inside this form because it is set to method get I really would like this checkbox because I would like to ensure that people have read my terms and conditions. Can anyone help find a solutionHere is the code. As you can see at the bottom there is two submit buttons. I only want one to add the files to my directory and also to be attached to the terms agreement. Photo: Please add photo here. Other Member Information: Please Enter any other Bands the Member has been in. Other Bands: By submitting, I agree that all info blah blah booby d was done accurately & truthfully. I accept:
VIEWS ON THIS POST

84

Posted on:

Friday 28th December 2012
View Replies!

Loop problem - JavaScript Help

I have two form n i wish to move the record from first form to another formvar lengthx=document.form4.elements.length;var length=document.form3.elements.length; var choosex=""; for(var x=0;x
VIEWS ON THIS POST

85

Posted on:

Tuesday 1st January 2013
View Replies!

tinyMce and datepicker problem - JavaScript Help

I'm using JQuery datepicker and it is succesully returning but I'm also using tinyMCE in the same form when the calender appears tinyMCe is disappearing.Here is my code $(function() { // Shorthand for $(document).ready(function() { $('select').change(function() { $.post('option.php', {data: $(this).val()}, function(data) { $('div').addClass('datepicker').html(data); // $( "#datepicker" ).datepicker(); // $( "#datepicker" ).datepicker.formatDate({dateFormat: 'yy-mm-dd'}); // $( "#taskTime").val() = $('#datepicker').datepicker({ dateFormat: 'yy-mm-dd', inline: true, //minDate: new Date(2010, 1 - 1, 1), //maxDate:new Date(2010, 12 - 1, 31), altField: '#datepicker_value', onselect: function(){ var day1 = $("#datepicker").datepicker('getDate').getDate(); var month1 = $("#datepicker").datepicker('getDate').getMonth() + 1; var year1 = $("#datepicker").datepicker('getDate').getFullYear(); var fullDate = year1 + "-" + month1 + "-" + day1; $('input[name=taskTime]').val(fullDate); } }); }); }); /* $(function() { $( "#datepicker" ).datepicker(); });*/ }); tinyMCE.init({ // General options mode : "textareas", theme : "advanced", plugins : "autolink,lists,pagebreak,style,layer,table,save,advhr,advimage,advlink,emotions,iespell,inlinepopups,insertdatetime,preview,media,searchreplace,print,contextmenu,paste,directionality,fullscreen,noneditable,visualchars,nonbreaking,xhtmlxtras,template,wordcount,advlist,autosave,visualblocks", // Theme options theme_advanced_buttons1 : "save,newdocument,|,bold,italic,underline,strikethrough,|,justifyleft,justifycenter,justifyright,justifyfull,styleselect,formatselect,fontselect,fontsizeselect", theme_advanced_buttons2 : "cut,copy,paste,pastetext,pasteword,|,search,replace,|,bullist,numlist,|,outdent,indent,blockquote,|,undo,redo,|,link,unlink,anchor,image,cleanup,help,code,|,insertdate,inserttime,preview,|,forecolor,backcolor", //theme_advanced_buttons3 : "tablecontrols,|,hr,removeformat,visualaid,|,sub,sup,|,charmap,emotions,iespell,media,advhr,|,print,|,ltr,rtl,|,fullscreen", //theme_advanced_buttons4 : "insertlayer,moveforward,movebackward,absolute,|,styleprops,|,cite,abbr,acronym,del,ins,attribs,|,visualchars,nonbreaking,template,pagebreak,restoredraft,visualblocks", theme_advanced_toolbar_location : "top", theme_advanced_toolbar_align : "left", theme_advanced_statusbar_location : "bottom", theme_advanced_resizing : true, // Example content CSS (should be your site CSS) //content_css : "css/content.css", // Drop lists for link/image/media/template dialogs template_external_list_url : "lists/template_list.js", external_link_list_url : "lists/link_list.js", external_image_list_url : "lists/image_list.js", media_external_list_url : "lists/media_list.js", // Style formats style_formats : [ {title : 'Bold text', inline : 'b'}, {title : 'Red text', inline : 'span', styles : {color : '#ff0000'}}, {title : 'Red header', block : 'h1', styles : {color : '#ff0000'}}, {title : 'Example 1', inline : 'span', classes : 'example1'}, {title : 'Example 2', inline : 'span', classes : 'example2'}, {title : 'Table styles'}, {title : 'Table row 1', selector : 'tr', classes : 'tablerow1'} ], // Replace values for the template plugin template_replace_values : { username : "Some User", staffid : "991234" } }); Here is my form Subject: Assigned To: Task: Select Task Controlled With Notification Periodically Simple On selecting the first and second option calender input is showing datepicker. Here is the php code
VIEWS ON THIS POST

60

Posted on:

Tuesday 1st January 2013
View Replies!

help with selection and alert - JavaScript Help

the javascript should have an alert popup indicating the ith selected (the index), but its not working.Here's the HTML:HTML5, CSS3, CSS, Javascript, AJAX practice golden retriever siamese cat goldfish parrot here's the JS in external script: js_.js function whichPet(var petList) { alert("You selected " + petList.options[selectedIndex].text); }
VIEWS ON THIS POST

64

Posted on:

Wednesday 2nd January 2013
View Replies!

[jquery] load() when success - JavaScript Help

how to do, that in the place of (selector) it would load the result of load() function, but only when it would be a successhttp://jsfiddle.net/AndyPSV/8myJ4/9/result of load() is: "ENGINE | record non"how(important)
VIEWS ON THIS POST

100

Posted on:

Wednesday 2nd January 2013
View Replies!

jQuery fixed div - JavaScript Help

I'm having a little trouble trying to force a div to the bottom of the screen.What i'm effectively trying to do is make a div with a fixed position of bottom: 0, but when going past a certain point, it stays there.For example, I have a div on the left/top with a height of 400 pixels, and the div I want to fix at the bottom is 400 pixels high. When I scroll down, the div at the bottom would be at the bottom, but when scrolling up, the top of that bottom div would 'stick' to the bottom of the top div (like being relative rather than fixed).I came across this plugin for jQueryhttp://www.chmoddesi...ollExample.htmlIt works really well, however they only give examples of headers or items on the top of the page. Theres nothing that does it from the bottom.I've tried using this code: $(document).ready(function() { $('#image').scrollToFixed({ marginBottom: 10 }); }); But no luck unfortunately. If anyone could shed some light on this, that'd be great
VIEWS ON THIS POST

70

Posted on:

Wednesday 2nd January 2013
View Replies!

Animating elements - JavaScript Help

Ok, I'm using jQuery for this. But I can't seem to nail it. Also I am not looking for a plugin to handle this effect.What I want to do is multiple animations at once. Having my elements expand and contrast in all directions at once while possibly moving the element off in another direction. My issue is I can't seem to nail this properly and I am looking for some insight as to fire off multiple animations at once to an element without having it queue up is that possible
VIEWS ON THIS POST

75

Posted on:

Wednesday 2nd January 2013
View Replies!

global vars help - JavaScript Help

i don't know how to make certain vars global, or at least available to several functions: function mult1() { // Get values from form mo = document.getElementById('monthly1').value; oft = document.getElementById('often1').value; // Compute the product. var product = mo*oft; // Display product in form. // document.wizForm.sc1_net.value = product; document.getElementById('net1').value = product; n1 = document.getElementById('net1').value; n2 = document.getElementById('net2').value; n3 = document.getElementById('net3').value; n4 = document.getElementById('net4').value; n5 = document.getElementById('net5').value; n6 = document.getElementById('net6').value; n7 = document.getElementById('net7').value; n8 = document.getElementById('net8').value; n9 = document.getElementById('net9').value; n10 = document.getElementById('net10').value; tot = parseInt(n1) + parseInt(n2) + parseInt(n3) + parseInt(n4) + parseInt(n5) + parseInt(n6) + parseInt(n7) + parseInt(n8) + parseInt(n9) + parseInt(n10); document.getElementById('total').value = tot; } i'd like to make n1 through n10 available to 10 functions just like this one, but i've not been able to. i've tried what i've found online, but to no avail.i'd REALLY like to make this function work for ten different forms, and requested help in another string, but have received no replies..
VIEWS ON THIS POST

77

Posted on:

Wednesday 2nd January 2013
View Replies!