print part of page script help - JavaScript Help


I have this script that when you place anything in div tags and give the correct ID it will print only that data. I ususlly works fine but since upgrading Firefox to 3.6.3 it only prints a blank page instead of the data on it.


Instructions to use:

place a div on your page and give it an id="printMe then add some content between the div and then finally add the head and body code and try and print it. Sometimes on Firefox it works for me and others it fails, It works fine in IE.
Posted On: Wednesday 2nd of January 2013 12:38:33 AM Total Views:  347
View Complete with Replies

RELATED TOPICS OF JavaScript PROGRAMMING LANGUAGE




dynamic

hi I'm interested in creating an effect like the attached. As the cursor (it's not displayed in the graphic for some reason) moves over links to the left; the background changes color to a deeper shade of blue, how nice! Is this simple to do help please Attached image(s)
VIEWS ON THIS POST

124

Posted on:

Wednesday 21st November 2012
View Replies!

Update amountleft on Dice Game roll

I am just about finished the dice game but am having trouble doing the calculation where if a player wins then they double their venture. I am not too sure how the game stores what the user picks in their venture 100 or 200. I am already subtracting their venture from the total when they initially make their venture. But if they win then I need to add back the venture to the total by 2. Not too sure how to do this. Do I use a new function. How can I tell which button the user chooses 100 or 200 and then add on that amount. Here is my code function decvars() { amtleft=0; venture1=100; venture2=200; ventureflag = 0; roller = 0; selvalue = 0; gameover=0; } // This is the routine to display the amountleft var amtleft; function bal() { document.balance.aleft.value = amtleft; timer=setTimeout("bal()", 1000) } // This is the function for the user to click an image and deposit money into their account - Cherylene Anderson 2009 function make_deposit(imgclicked) { amtleft = amtleft + imgclicked; alert("You have deposited $" + imgclicked); } // This is the function for the user to click button and make venture 100 or 200 - Cherylene Anderson 2009 var takeapick=0 function myventure() { if (document.balance.aleft.value >0) { if (takeapick == 1) { amtleft = amtleft - venture1; alert("You have ventured $100"); alert("You have $" + amtleft + " in your account") ventureflag = 1; ventvalue = 1; } else if (takeapick == 2) { amtleft = amtleft - venture2; alert("You have ventured $200"); alert("You have $" + amtleft + " in your account") ventureflag = 1; ventvalue = 2; } } else { alert("You must deposit money before making a venture"); } } // This is the function for user to choose what they think the dice will roll 1 to 4, 5 to 8 or 9 to 12 - Cherylene Anderson 2009 var userchoice=0 function selection() { if (ventureflag >0) { if (userchoice == 1) { alert ("You have chosen 1 to 4"); alert ("Now roll the dice"); roller = 1; selvalue = 1; } else if (userchoice == 2) { alert ("You have chosen 5 to 8"); alert ("Now roll the dice"); roller = 1; selvalue =2; } else if (userchoice == 3) { alert ("You have chosen 9 to 12"); alert ("Now roll the dice"); roller = 1; selvalue =3; } } else { alert("You must make a venture before making a selection"); } } // This is the function for rolling two dice - Cherylene Anderson 2009 var diceroll; function dice_roll() { if (roller >0) { var mydice = new Array mydice[1] = "images/dice1.gif" mydice[2] = "images/dice2.gif" mydice[3] = "images/dice3.gif" mydice[4] = "images/dice4.gif" mydice[5] = "images/dice5.gif" mydice[6] = "images/dice6.gif" var diceimage=Math.round(Math.random()*5) var diceimage2=Math.round(Math.random()*5) diceimage = diceimage +1; diceimage2 = diceimage2 +1; document.diceimage2.src=mydice[diceimage2]; document.diceimage1.src=mydice[diceimage]; var dicetotal = diceimage + diceimage2; alert("Dice total is " + dicetotal); if (dicetotal
VIEWS ON THIS POST

102

Posted on:

Wednesday 21st November 2012
View Replies!

issue with document.forms blur

I just inhereited a mobile app on my website that is programmed in JS using sensa touch. I've been doing ok getting things up and running and has been going fine. However two days ago it just started not allowing users to login. I narrowed it down to one line of code that all of a sudden stopped the function from making the ajax request. document.forms('loginForm').elements[1].blur(); No one had touched it, it just stopped working. For now I've just commented it out and it's allowing users to login but it is causing a couple of issues. If someone could point me in the right direction I would be very apreciative.
VIEWS ON THIS POST

123

Posted on:

Wednesday 21st November 2012
View Replies!

Error: "Missing ; Before Statement"

I am trying to create a function that will move a selected option from one dropdown to either another dropdown or a list depending on arguments passed to it. moveOption(dropdown,container,dataType){ var $dropdown = $(dropdown); var $addedVals = $(container); var htmlOut = ''; if(dataType == 'option'){ htmlOut = '' + $dropdown.find('option:selected').text() + ''; }else if(dataType == 'list'){ htmlOut = '' + $dropdown.find('option:selected').text + ''; } $addedVals.append($dropdown.val()); // Remove value from the drop down $dropdown.find('option:selected').remove(); } I get an error whenever I try to write the code or run it (in Firebug). The error is Missing ; Before Statement
VIEWS ON THIS POST

70

Posted on:

Wednesday 21st November 2012
View Replies!

JavaScript on Windows Mobile 5.0

I am using a PDA containing Windows Mobile 5.0 for my client application in JAVA (JSP & SERVLET).There i am using a dropdown menu on a page.There are 3 different values (A,B,C) in that drop box.My question is that....when i select/change any value from that dropdown menu,color of this row (the row containing dropdown menu)should be changed.There is different color for each value in that dropdown menu.(green for A,red for B,gray for C) I am using following Javascript code in my JSP page,that is working successfully on Desktop PC. ------------------------------------------------------------------------------------------------------------------- New Page 1 function check(aa) { document.getElementById("glow").style.backgroundColor=document.g etElementById('abc').value; } A B -C ------------------------------------------------------------------------------------------------------------------- This code is working successfully on Desktop PC as well as WIndows Mobile 5.0. But when i change event name to "onclick()" (in place of onchange())...(code is gven below) ------------------------------------------------------------------------------------------------------------------- New Page 1 function check(aa) { document.getElementById("glow").bgColor=document.g etElementById('abc').value; } A B -C ------------------------------------------------------------------------------------------------------------------- This code is working successfully on Desktop PC but it is not working on Windows Mobile 5.0.(Colors are changed on Desktop but not on my PDA (WM 5.0)). Can anyone guide me how can i use "onclick()" event on Windows Mobile 5.0 i have attached screenshots to help. Attached image(s)
VIEWS ON THIS POST

64

Posted on:

Wednesday 21st November 2012
View Replies!

JS code golf

Par 2 Well, I have noticed the other forums doing this, and thought that we would add a challenge of the same type here. For hole one you just want to get as short a code segment as you can (you can use any language though you get bonus points if you use JS). Here is what the script must accomplish: Output five rows of numbers counting up from 1. On the first row there should be 1 number, the second should have 2, and so on down the line until you have finished. Each number should be comma separated. The last number on a line should not have a trailing comma. Example output: 1 2, 3 4, 5, 6 7, 8, 9, 10 What to count: Count all non-whitespace characters. Then count all required whitespace characters (spaces). For example for(var i = 0; i < 10; i++); is only 22 characters because the space between var and i is required, but the rest of the spaces can be removed while not changing the program's output. Have fun and go for the lowest character count you can get.
VIEWS ON THIS POST

219

Posted on:

Thursday 22nd November 2012
View Replies!

page not displaying jpg pictures

; First let me start with that I have not done any scripting in a few years, until i landed this job, my first task was to upgrade the company's website, so I thought it would be great to have the head of the site change according to time of day. Well I can't get the page to display anything. I have an external CSS for the formatting of the headings and the body, but nothing display at all. So i was wondering if someone could lead me in the right direction I will post both the CSS and javascript, although i think the css is right day=new Date(); //..get the date hours=day.getHours(); //..get the hour if(hours>=0 && hours=5 && hours=7 && hours=12 && hours=16 && hours=20 && hours
VIEWS ON THIS POST

184

Posted on:

Friday 23rd November 2012
View Replies!

Spry Validation Textfield Moves Entire Form to the?

Hi good day. I am currently using Spry Textfield Validation on my forms. Whenever there is an error, the error message does appear and the field goes red. However, the entire form is shifted to the left a couple of pixels. If the user corrects the value in the field, the form goes back to the right. What is wrong with this I am using the default code on DreamWeaver. Here are the concerned parts of the code: ... Password: A value is required.Minimum number of characters not met.Exceeded maximum number of characters. ... var sprytextfield1 = new Spry.Widget.ValidationTextField("sprytextfield1", "none", {minChars:8, maxChars:20, validateOn:["blur"]}); Nothing was changed save for adding the min and max chars plus the validate on blur. Hope someone can help.
VIEWS ON THIS POST

80

Posted on:

Saturday 24th November 2012
View Replies!

How to access web service data which is continuous?

I wants to access my web page which data is continuously growing, I want to buffered some of that data write it in responseText then again get next buffered data write it and so on (in AJAX). Is it possible and how i can do that
VIEWS ON THIS POST

105

Posted on:

Saturday 24th November 2012
View Replies!

Javascript OO

I've a question when creating a class with functions. e.g. function constructor() { this.myFunc = function() { return " World"; } } do I have to write the function in that way this.funcName = function() for every function in that class Because when I tried to write it in this way instead function constructor() { function() myFunc{ return " World"; } } It does not work if it is bundled like function in a function. When I create an object of constructor, and then try to call the myFunc function.
VIEWS ON THIS POST

68

Posted on:

Saturday 24th November 2012
View Replies!

Dynamic Login

all, I've submitted something similar in the asp.net forum so if you frequent both you'll see it in both places. I'm curious if javascript or ajax can help us accomplish some of our tasks, here is the post in the other thread: all, I'm a bit newer and looking for some direction. We would like to create a new website and have that do some dynamic things based on login id. First all we would like to send you do a different home page based on this information, it might be one of several companies. This may also be tied to what URL you clicked but not necessarily. The second thing we would like to do is display only the products that you are eligible for based on your login information. We would like to use images as a link here and if you can sell one product you get one image or maybe bypass and go directly to that section, but if you can sell two or more then those images as links show up as available. The final thing we want to do is to populate the top 3 or so items you perform on the site as quick links. After all that, are there tools or items I should study to help us accomplish this task I'm not sure if I need to mix in some sort of third party analytical tool with the asp.net site or what. Any help or guidance would be greatly appreciated, even if it's only "hey check out X it might help you with some of your work" (I know I know, what we need is a real web developer who has experience. Aside from that though lol) * The only other thing that I think we can do with ajax is have them say enter a a vehicle identification number and without looking like a screen reload use ajax to show the additional information such as year make and model that are decoded from the vin, but I'm just starting to look into this.
VIEWS ON THIS POST

72

Posted on:

Saturday 24th November 2012
View Replies!

how to implement ajax edit in place with asp 3.0

i am new to ajax technology but i am working with ajax on my site. i am having a problem with a ajax edit form element in place when i try to implement it in asp vbscript. hopefully someone here can help me in detailed. what i need to do is the edit in place function which similar as the flickr.com. i have found some example code on net. but when i try to implement it with asp, it seem not work. after i save it, it seem not update my Db record. and i try to refresh the page. the page will display back the default msg like: "click here to edit." the reference web that i refer is as below: http://www.php-learn-it.com/tutorials/ajax_edit_in_place.html tis is implement with php code but i m using the asp. i looking forward someone can guide me in detailed and how to start it. i am not request for whole code. but i need some help on how to modified tis reference code. if anyone can help, I would greatly appreciate it.
VIEWS ON THIS POST

136

Posted on:

Saturday 24th November 2012
View Replies!

Can't put 2 Javasript working in the same page!

I am working on a website and I dont know much of Javascript,but I need to put to work different scripts on the page,and it wont work!:sad: I've already try to chage all that I remeber to chage,but dosen't work!What I am doing wrongCan anybody help me out Here is my code: window.onload = function() { // Pick your classes var myBox = document.getElementsByClassName('box_title'); var myBoxOpen = document.getElementsByClassName('information'); // Create the accordion var myAccordion = new fx.Accordion( myBox, myBoxOpen, { onActive: function(tog){ tog.setStyles({color: '#fff', background: '#840000'}); }, onBackground: function(tog){ tog.setStyles({color: '#b7d30b', background: '#7d8c87'}); }, alwaysHide: true } ); } function MM_callJS(jsStr) { //v2.0 return eval(jsStr) } $(document).ready( function(){ $('ul#hFade').innerfade({ speed: 7000, timeout: 13000, type: 'sequence', containerheight: 'auto' }); });
VIEWS ON THIS POST

109

Posted on:

Saturday 24th November 2012
View Replies!

Stop continuous script execution?!

I am (obviously) extremely new to javascript. I need to have this script execute once, then quit. I've tried several commands but I must be an idiot...could someone please help me modify it
VIEWS ON THIS POST

81

Posted on:

Saturday 24th November 2012
View Replies!

Sending mail througth js

Using js i want to send mail can anyone give some example code for that
VIEWS ON THIS POST

142

Posted on:

Saturday 24th November 2012
View Replies!

Selecting at least one field is not working

Hi to all i have done validation on single fields but i have to apply validation on 3 text field that at least one of thre is filled .i make a code but that logic doesnot work .. html code ID Technologies First Name: Last Name : Organization Name: Email: Contact Number: Duration in years: Extend Read Only Download link MAC ID: CPU ID: MotherBoard ID: js code function validate_required(field,alerttxt) { with (field) { if (value==null||value=="") { alert(alerttxt); return false; } else { return true; } } } function validate_email(field,alerttxt) { with (field) { apos=value.indexOf("@") dotpos=value.lastIndexOf(".") if (apos
VIEWS ON THIS POST

139

Posted on:

Sunday 25th November 2012
View Replies!

edit caption of image in lightbox

hello ! im just wondering if it is possible to edit the caption of an image while it's being viewed through lightbox
VIEWS ON THIS POST

282

Posted on:

Sunday 25th November 2012
View Replies!

missing ) after argument list

Man put your code here. And make sure to use code tags :). Then only we can help you. Well by seeing the image. It should be something like this. GetProduct("7 For Mankind Relaxed Vintage Honululu Denim", 1028, 215); not GetProduct(7 For Mankind Relaxed Vintage Honululu Denim, 1028, 215);
VIEWS ON THIS POST

160

Posted on:

Sunday 25th November 2012
View Replies!

get elements within a div tag

I have a couple of div tags inside a form, inside those tags, there are input elements, i would like to know if there is a way to loop over all the input elements that are inside the div tags. This has to be dynamic as i will not know the exact number of div tags or elements. Any ideas or directions for me to search. Thanx., Thanx SOS, i was able to get all the elements using the elements tag, but had no idea about the getElementByTagName, this will make my life so much easier. Thanx again.
VIEWS ON THIS POST

150

Posted on:

Sunday 25th November 2012
View Replies!

Problems with Java and Web conferencing

I need to use a Web conferencing system that does not require a download. I tried using one that uses Java but several of my clients had problems because their JVM was not compatible or they did not have a JVM installed. Is there a Web conferencing system with no download that does not require Java
VIEWS ON THIS POST

128

Posted on:

Sunday 25th November 2012
View Replies!

javascript warning message for value field

how to show a javascript warning message for some specific words from a textfield. if a user write http:// and / in a textfield and click on the Submit button of my form then a javascript will show a error message to the user and submission will stop. How to do it Please give me a example regarding this. How i should edit this below given code: Javascript warning Demo formURL
VIEWS ON THIS POST

96

Posted on:

Monday 26th November 2012
View Replies!

Need compatibility help

Ok so i have no clue why this doesnt work in FF, works perfectly fine in Chrome and IE. Whats suppose to happen is, on mouseOver (in a link in a seprate part of the html), the statsOff is suppose to be hidden and statsShow is suppose to be shown, with the information it from the php page. This all works fine in Chrome and IE, but not in FF. What happens in FF is, the statsOff is hidden, and statsShow is displayed, BUT none of the info is displayed, and neither is the loading image. the Javascript/Ajax function letWeapon(mouseStat) { highlighted = document.getElementById("statsShow"); unHighlighted = document.getElementById("statsOff"); highlighted.style.display="none"; unHighlighted.style.display=""; } var xmlhttp function getWeapon(id) { highlighted = document.getElementById("statsShow"); unHighlighted = document.getElementById("statsOff"); highlighted.style.display=""; unHighlighted.style.display="none"; if (id.length==0) { document.getElementById("statsShow").innerHTML=""; return; } xmlhttp=GetXmlHttpObject(); if (xmlhttp==null) { alert ("Your browser does not support XMLHTTP!"); return; } var url="test.php"; url=url+"id="+id; url=url+"&sidd="+Math.random(); xmlhttp.onreadystatechange=stateChanged; xmlhttp.open("GET",url,true); xmlhttp.send(null); if(xmlhttp.readyState !=4){ document.getElementById("statsShow").innerHTML=(""); } else{ function stateChanged() { if (xmlhttp.readyState==4) { document.getElementById("statsShow").innerHTML=xmlhttp.responseText; } } } function GetXmlHttpObject() { if (window.XMLHttpRequest) { // code for IE7+, Firefox, Chrome, Opera, Safari return new XMLHttpRequest(); } if (window.ActiveXObject) { // code for IE6, IE5 return new ActiveXObject("Microsoft.XMLHTTP"); } return null; } } The html Hovered Weapon Details The php $id = $_GET['id']; $testingquery = mysql_query("SELECT * FROM weapon WHERE owner='$username' AND id='$id'");; $testfe = mysql_fetch_object($testingquery); $testcount = mysql_num_rows($testingquery); if(strlen($id) > 0 && $testcount != 0){ switch($testfe->type){ case 1: $type = "Primary"; break; case 2: $type = "Secondary"; break; case 3: $type = "Special"; break; case 4: $type = "Throwable"; break; } $response = " Name: $testfe->name Type: $type Damage: ".number_format($testfe->mindmg)." - ".number_format($testfe->maxdmg)." EN: ".number_format($testfe->energy)." Ammo Remaining: ".number_format($testfe->cammo)." Shots Sell For: ".number_format($testfe->value)." Bio-Cells $equipask "; } else{ $response = "There is no such weapon found"; } echo $response > This post has been edited by Redman-Racer: 08 March 2010 - 03:24 PM
VIEWS ON THIS POST

169

Posted on:

Monday 26th November 2012
View Replies!

Help with an script.

First of all sorry for my bad thread title, really didn't know how to name it. I am wondering how to make a following banner to another page. e.x: When somebody clicks a link from my webpage to show the link with my extra code. Like this alexa banner up there: Click here. I am very low with scripts, so I was thinking about coding something using VB.net and C++, but it will be too slow i think. If you have that script, or you know something that can help me, please share.
VIEWS ON THIS POST

72

Posted on:

Monday 26th November 2012
View Replies!

jQuery toggle

Hi folks. I'm playing about with jQuery at the moment but I really don't have any js knowledge so I am going mostly by guess work. I ordered 2 js books yesterday though so I should be able to at least start learning the basics in a few days. I am using the jQuery 'toggle' function and got it working nicely. Click Me The visibility of this gets toggled $('#block1').click(function () { $('#toggle1').toggle('slow'); }); This works fine if I have a single block of elements to toggle but if I have multiple blocks of (dynamically generated, this code is inside a foreach loop), and I want to have separate toggling in each block, I need to increment the id (block1 to block2 and toggle1 to toggle2 etc). I can use PHP to break the HTML statement and insert a variable to increment the id in the tags but how do I increment the id in the javascript I hope I managed to explain this well enough for people to understand what I'm talking about :confused: Zagga
VIEWS ON THIS POST

112

Posted on:

Monday 26th November 2012
View Replies!

usability issue to fix with javascript/jquery

Hi peeps, I wonder if anybody can give me a hand with this. Basically on my website http://antobbo.webspace.virginmedia.com/photography/testing/gloom.htm to view a picture you need to use the left hand-side menu. Now, all good except that when you want to view any picture at the bottom of the left hadn-side nav you need to scroll all the way down, losing the main picture and then you need to scroll all the way up again. So I was thinking to have a next button which will have the same function as the left hand-side navigation. I thought it would have ben easy but it's now 10 hours I am working on it and I really don't seem to be able to get anywhere. I tried many conbinations, here's some of the attempts: 1) I created the button: Next then the script: Let me explain what I was attempting to do. I created 3 arrays mainPictures, thumbPictures and thumbShadedPictures because when I click on a thumbnail on the left the big picture in the middle changes and the thumbnail becomes shaded. Then when I click on a another thumbnail, the previous one goes back to normal and the selected one turns shaded and so on, hope it is clear. So what I want to do with the arrays is to make sure that all that happens. So in function nextPicture() I grabbed the id pic_1 which is referenced in the body of the page that didn't work 2)after few hours I came up with this, managing to at least fading out the main picture: The problem here is that I can only change the first 2 pictures because I don't seem to be able to assign to pic_1 the subsequent values in the mainPictures array I can go on for quite a bit, but I will post only the last attempt which didn't use arrays: 4)
VIEWS ON THIS POST

167

Posted on:

Monday 26th November 2012
View Replies!

setAttribute problem with firefox

kaydet.setAttribute("onmousedown",function valSupport(){ if (takim1.value==""){ alert("isim Girmelisiniz"); takim1.select(); return false; } return true; }); this function works in ie7 but didnt work in firefox 2. I tried some other ways then it didnt work on both. this way seems the best one for now but how come firefox cant recognize the function. When i clicked on the image, nothing happens.
VIEWS ON THIS POST

83

Posted on:

Monday 26th November 2012
View Replies!

Passing C# variable to a javascript confirm box

not sure if posting it here is the right spot but lets hope so. I have an asp.net application where i need a confirmation box to pop up upon someone clicking a submit button. This confirmation box needs to have a variable passed to it. the thing is the variable isnt getting passed and also the C# code behind the button isnt getting executed. // btnSubmit.Attributes.Add("onclick", "return ConfirmationWindow();"); // Page.ClientScript.RegisteronsubmitStatement(this.GetType(), "key", "if(!confirm('Phone number is . Do you want to continue'))return false;"); //String scriptText = "return confirm('Phone number entered is ' + document.getElementById('txtSavePhoneNum').value + '. Is this correct')"; //ClientScript.RegisteronsubmitStatement(this.GetType(), // "ConfirmSubmit", scriptText); //Page.ClientScript.RegisteronsubmitStatement(this.GetType(), "confirm", scriptText);
VIEWS ON THIS POST

125

Posted on:

Monday 26th November 2012
View Replies!

Restrict an html text input to only take default values

, I was wondering if it is possible to restrict the values of a text input box to only accept set values such as "XBC1". I am trying to make a form for a scanner so you can scan bar codes and it will auto fill the form out and have default values set so incorrect values cant be submitted into the database and mess everything up. Another question i have is, is it possible to populate the input box with a java array. Thank you for your time.
VIEWS ON THIS POST

105

Posted on:

Monday 26th November 2012
View Replies!

jQuery drag/drop fails on ie9. Confused about hotfix - JavaScript Help

This is my development box: http://neucart.com/demo/. Items can be dragged/dropped into the cart (grab the image). This fails in ie9.The issue is known and addressed here:http://forum.jquery....not-work-in-ie9I tried to add the hotfix. Doesn't work.I tried to upgrade all of my jQuery library but that made things worse (drag/drop failed on all browsers). I'm more of a server-side developer; can someone help me out
VIEWS ON THIS POST

129

Posted on:

Tuesday 27th November 2012
View Replies!

Using link in child window to write to textbox in parent window - JavaScript Help

I am having a struggle with some coding. I have a page where you can open a popup window with a bunch of links on it. I want to be able to click a link and have the information obtained on the link write to a textbox on the parent window. The window needs to stay open so they can click on several links and add a bunch of information to the text box. My current coding for the child window is: while($row = mysql_fetch_array($result)) { echo"
VIEWS ON THIS POST

160

Posted on:

Tuesday 27th November 2012
View Replies!

Trimming

How can I trim a field in Javascript I tried: function trim(strValue){ return(strValue.replace(/^s+/,'').replace(/\s+$/,''));} But it doesnt seem to work. Here's the full code;
VIEWS ON THIS POST

120

Posted on:

Thursday 29th November 2012
View Replies!

how to replace only last text inside tag

$(document).ready(function(){ $('#second').click(function(){ $('div#first').html(function(i,v){ return v.replace(/[0-9]+/g,'XYZ9876'); }); alert('Changed'); }); }); [edit] 0123 I'm trying to replace the only text "ABC0123" inside #first and every thing should remain the same like: [edit] XYZ9876 By using above code resolve this problem for first click. But when i click second or third or more time, click event not working. i have to write such code that clicking on any number of time it should fire the click event. Can anyone suggest me the right way to do this.
VIEWS ON THIS POST

125

Posted on:

Thursday 29th November 2012
View Replies!

hello how i can write in a that if var r is nan and if r is null

if i want to write absent if r is null what i should do\t welcome and i dont want to use functions\t
VIEWS ON THIS POST

116

Posted on:

Thursday 29th November 2012
View Replies!

Javascript not working

My java script of validation is not working don't know why here is the code Header php file simple document Home Kids Wear Mens Wear Women Wear SCRIPT function req(field,alertmsg) { with(field) { if(value==null||value=="") { alert(alertmsg); return false; } else { return true; } } } function compare(field1,field2) { var val1 var val2; with(field1) { val1=value; } with(field2) { val2=value; if(val1!=val2) { alert(" Do not Match "); return false; } else { return true; } } } function validate(thisform) { with(thisform) { if(req(un,"User name must be filled")==false) { un.focus();return false; } if(req(pass,"Enter the Password")==false) { pass.focus();return false; } if(req(pass1,"Enter the Password again")==false) { pass1.focus();return false; } if(req(credit,"Cerdit Card Number must be filled")==false) { credit.focus();return false; } if(req(email,"Valid Email-ID must be filled")==false) { email.focus();return false; } if(req(email1,"Enter Email-ID again")==false) { email1.focus();return false; } if(req(name,"Name filled cannot be Empty")==false) { name.focus();return false; } if(req(add,"Address must be filled")==false) { add.focus();return false; } if(req(city,"City must be filled")==false) { city.focus();return false; } if(req(pin,"Pin Code must be filled")==false) { pin.focus();return false; } if(req(state,"State must be filled")==false) { state.focus();return false; } if(req(coun,"Country must be filled")==false) { coun.focus();return false; } if(req(mob,"Phone number must be filled")==false) { mob.focus();return false; } if(compare(email,email1)==false) { email1.focus(); return false; } if(compare(pass,pass1)==false) { pass1.focus(); return false; } } } REGISTRATION PAGE //here where i call it User Name: Password: Confirm Password: Cerdit Card No: Email-Id: Confirm Email-Id: Full Name: Address: City: PinCode: State: Country: Phone Number: This post has been edited by Dormilich: 18 January 2011 - 10:16 AM Reason for edit:: moved to JavaScript Forum, not a PHP issue
VIEWS ON THIS POST

62

Posted on:

Thursday 29th November 2012
View Replies!

popcorn.js plugins not working.

I recently started a website that makes use of popcorn.js. As you may know popcorn.js makes use of plugins. Now I'm using the youtube player plugin. It makes use of the swfobject.js. But when the popcorn.js calls it there is no get. And this concerns all of the plugins. I tried by downloading the swfobject and put it in the same map. But then popcorn fails at the following piece of code: swfobject.embedSWF( "//www.youtube.com/e/" + src + "" + query + "&enablejsapi=1&playerapiid=" + container.id + "&version=3", container.id, width, height, "8", null, flashvars, params, attributes ); Does anyone know what is causing the problem in the popcorn.js With friendly greetings, Wesley
VIEWS ON THIS POST

91

Posted on:

Thursday 29th November 2012
View Replies!

Dynamic Div Generation with JS

! I am trying to figure out how to dynamically generate div ids, and then use onclick in correspondence with an image to pull up the correct div. I have been stumbling on this for two weeks and don't know where to turn at this point. Below is the current onclick JS function, but I have no start for the dynamic div generator.
VIEWS ON THIS POST

304

Posted on:

Thursday 29th November 2012
View Replies!

Weird Opera bug?

I'm working on a website that nests framesets within other framesets. I want a click in one top-level frame to show/hide a menu in a second level frame. Hete's a code fragment: var cousin2_doc = brother_frameset['main-main'].document var d = cousin2_doc ...
VIEWS ON THIS POST

93

Posted on:

Friday 30th November 2012
View Replies!

New Software Development Links Directory

SoftDevLinks.com is a new general directory for software developers, testers and managers. If you have a blog, a web site, distribute a tool or work a consulting company related to software development, do not hesitate to add a (free) link ...
VIEWS ON THIS POST

203

Posted on:

Friday 30th November 2012
View Replies!

The .Net Way to get the XML Payload from the Request?

In ASP2.0, on the server the following server-side code could be used to load XML sent via the XMLHTTP object from a client: <%@language=jscript%> <% var domDocument = Server.CreateObject( 'MSXML2.DOMDOCUMENT' ); domDocument.load( Request ); %> I always thought it was ...
VIEWS ON THIS POST

130

Posted on:

Friday 30th November 2012
View Replies!

Problem dealing with double quotes in InnerHTML

Hi Friends, I am stuck up here. to simplify i have made a demo program.

3434 it surprisingly removes the double quotes in IE6. I need that when onclick is fired i should also get double quotes. ...


VIEWS ON THIS POST

87

Posted on:

Friday 30th November 2012
View Replies!

Help! - Mathmatics with variables

i am trying to add two values together from two text fields and place them in another text field, i know a little javascript and have got the basics working, only i cant't get the values to add together, ...
VIEWS ON THIS POST

86

Posted on:

Friday 30th November 2012
View Replies!

ActiveXObject

, i'm tring to get a file size by writing: var fso = new ActiveXObject("Scripting.FileSystemObject"); and i get the error: Microsoft JScript runtime error: Automation server can't create object any ideas Oren...
VIEWS ON THIS POST

99

Posted on:

Friday 30th November 2012
View Replies!

disable right mouse clicking in javascript

how is it possible to disable right mouse clicking in javascript!! my library did it so i know it CAN be done...
VIEWS ON THIS POST

134

Posted on:

Sunday 23rd December 2012
View Replies!

Java Script Frame work

I am new to javascript and I was looking for some thing to help me to grow at my coding. I downloaded UIZE Framework and thought it would be a complier like I used in C++. Can some one explain to me what a frame work is and how to use it. I do not what something that will write my code for me I want to do that. But I would like some thing that would help keep me on track.
VIEWS ON THIS POST

65

Posted on:

Monday 24th December 2012
View Replies!

JavaScript Cheatsheet

-content removed-
VIEWS ON THIS POST

67

Posted on:

Monday 24th December 2012
View Replies!

Slider not working - JavaScript Help

,Does anybody have any idea why the slider on the webside is not working
VIEWS ON THIS POST

73

Posted on:

Friday 28th December 2012
View Replies!

Spry Accordion Help - JavaScript Help

I am trying to incorporate a spry accordion into my site. I have the accordion exactly how i want it except, I don't want the first panel to be open when the page loads. I want the user to have to click which panel to open.Everything i've read online says this is in javascript but everything that i read has been wrong so far! Cause I'm still stuck!!
VIEWS ON THIS POST

56

Posted on:

Monday 31st December 2012
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 generating discounts using JavaScript - JavaScript Help

Hi Everyone,I have created some code that lets a user fill out an order form. e.g Name, Email etc etc....But they also have the option to type in a reference code from a catalog, type in what price it is and how much of a quantity they want. This will generate a total. The user can do this 3 times and it will generate a grand total. Then this will post to the clients email and they will follow the order up. I no it's not the best way but it's what they client wants.The next stage of the project is too generate discount from the grand total field. For example:If the Grand Total is between 15-129 this is = 10% thenif the Grand Total is between 130-249 this is = 15% offif the Grand Total is greater than 250 this is = 25% offHere is my code with PHP that emails the form. I hope someone can help me with this any help would be great. This is a working example if you just change the email address at the top and i've attached the include file corefuncs.php. 3) return string.substring(0,string.length-dec+3); return string; }//End money function (again please do not touch!!!!) function calculate() { QtyA = 0; QtyB = 0; QtyC = 0; TotA = 0; TotB = 0; TotC = 0; PrcA = 0; PrcB = 0; PrcC = 0; //Below the code for the price if (document.ofrm.prcA.value > "") { PrcA = document.ofrm.prcA.value }; document.ofrm.prcA.value = eval(PrcA); if (document.ofrm.prcB.value > "") { PrcB = document.ofrm.prcB.value }; document.ofrm.prcB.value = eval(PrcB); if (document.ofrm.prcC.value > "") { PrcC = document.ofrm.prcC.value }; document.ofrm.prcC.value = eval(PrcC); //Below the code for the quanity if (document.ofrm.qtyA.value > "") { QtyA = document.ofrm.qtyA.value }; document.ofrm.qtyA.value = eval(QtyA); if (document.ofrm.qtyB.value > "") { QtyB = document.ofrm.qtyB.value }; document.ofrm.qtyB.value = eval(QtyB); if (document.ofrm.qtyC.value > "") { QtyC = document.ofrm.qtyC.value }; document.ofrm.qtyC.value = eval(QtyC); //Get the totals for the calculator (May need to be altered) TotA = QtyA * PrcA; document.ofrm.totalA.value = dm(eval(TotA)); TotB = QtyB * PrcB; document.ofrm.totalB.value = dm(eval(TotB)); TotC = QtyC * PrcC; document.ofrm.totalC.value = dm(eval(TotC)); Totamt = eval(TotA) + eval(TotB) + eval(TotC) ; document.ofrm.GrandTotal.value = dm(eval(Totamt)); if (document.ofrm.GrandTotal.value > 55) } Pennine Trophies Order form Please make your selections from the following choices. If you have any problems feel free to contact us via the contact page. Please complete the field(s) marked (*) * Sorry, there was a problem sending your message. Please try later. thankyou for your email we will contact you shortly Name:* * * Wording Reference Quantity Rate Total 1. /> /> 2. /> /> 3. /> /> Totals
VIEWS ON THIS POST

53

Posted on:

Wednesday 2nd January 2013
View Replies!

Help in Jquery form serialize result into php variable!! please - JavaScript Help

Hi all,I have recently i have found out a fantastic function in jquery called serialize, which allow form values to show without submitting it..http://api.jquery.com/serialize/I wanted to integrate it with php and phpmyadmin, but i couldn't understand the var str = $("form").serialize(); $("#results").text(str);How could I get the value and set it into variables in php\t.. using php serialize functionPlease help me I'm lost, as I'm fresh to jquery and javascript :(
VIEWS ON THIS POST

109

Posted on:

Wednesday 2nd January 2013
View Replies!