Make A Hollow Square For Loops?

Oct 26, 2009

I am trying to make a hollow square for loops this is what i got but i dont want my loop to go infinite i just want my loop to stop after first time.

<html>
<head>
<script type="text/javascript">
var squareSize;

[Code].....

View 8 Replies


ADVERTISEMENT

Get Square And A Select?

Oct 28, 2009

I have the following code:

function createSquare(event) {
var x = parseInt(event.clientX);
var y = parseInt(event.clientY);[code].....

This shows me a square and a select but the select isn't populated with anything.i do have a form later on down the page. The form code is (which I try and pull in the info from the select in the form in the select in the createSquare:

<form action="" name="tag" method="post">
<input type="hidden" name="picture_id" value="4">
<select name="tagged_person" id="tagged_person">[code]....

View 6 Replies View Related

Textfield Name Containing Square Brackets

Jul 20, 2005

I'm hoping that someone can help me with a question I have about javascript syntax.

I got an html page that uploads an image and some text field to a database.

What I'd like to do is modify the content of one of the textfields prior to it being submitted to the database. Specifically, I need to append the contents of one of the fields to another.

The problem that I've encountered is that the textfield name contains square brackets , ‘extra_fields[Price]'

I've identified the square brackets as being the problem by changing the textfield's name to one that doesn't contain square brackets ,extra_fieldPrice for example and the script works fine.

Unfortunately, in the real world application of this page, I can't change the textfield name.

The specific part of the html page that's giving me problems is:

View 1 Replies View Related

Rotate A Triangle / Square?

Oct 10, 2011

I know very little about javascript, but was wondering if something like this can be done?

Would it be possible (with mootools or jquery) to have homepage that will rotate its home page content forwards and backwards based on either triangle or square? ie, you can rotate through 3, 4, etch home pages?

Sort of like a slider, but it rotates off a center axis of the triangle or square?

View 3 Replies View Related

Javascript Square Root

Dec 12, 2006

I cannot manage to do a square root operation. I am using the coding:

var a = Math.sqrt(b);

View 3 Replies View Related

Getting An Empty Square Character?

May 8, 2010

getting an empty square character instead of a space.Looks ok printed by php.It seems to happen after I use rubout or delete and then type a space in my JS editor; when the edited text is displayed via ajax in a JS tooltip, I see an empty square.Hundreds of articles have this problem so I need a way to remove them. Iv'e tried various character replacements but can't seem to determine what the square character is (char code).

View 2 Replies View Related

Object Names With Square Bracket

Jul 23, 2005

i want to update several Textboxes by reading the value of another Box. For that i use the following small script:

<form name="form1" method="POST">
<input type="text" name="xx" value ="1"

<input name="tex1" type="text" size=16 maxlength=80 value="1">
</form>

Everything works fine, but for my PHP-Script i need square brackets [
]. If i try to add them, my Script got an error:

<form name="form1" method="POST">
<input type="text" name="xx" value ="1"

<input name="tex[1]" type="text" size=16 maxlength=80 value="1">
</form>

Whats wrong?

View 1 Replies View Related

JQuery :: Square Brackets In Selectors?

Apr 9, 2011

While trying to get a selector to work with ids that include square brackets, I searched the forum and found that I needed to escape the brackets with '\'. However, while this works with my fiddle: can't get the exact same selector to work within my page in either FF or Safari. I've triple-checked the id and it is correct; I know that jQuery is working on the page because changing the selector to$('.nameinput') gives the expected results. can't change the id because I'm working within an existing application; I know I could add a class to the input and use that as the selector instead. I'd prefer not to and would just like to figure out why this isn't working.

View 1 Replies View Related

JQuery :: Square Brackets [0] Mean At The End Of A Selector?

Feb 9, 2011

I do undersand the basic notation of jQuery selectors, but I don't understand what the [0] means in the following code snipet:

$("body").append(
$([
overlay = $('<div id="lbOverlay" />')[0],

[code]....

View 2 Replies View Related

Query :: Turn A Square Image Into A Triangle?

Sep 28, 2011

Basically what I need to do is take a number of elements, lets say 6 in this case, all of which are div's with an image child e.g.

<div class='triangle-element'>
<img src="../images/face.jpg" />
<div>

View 1 Replies View Related

Need To Remove Empty Square Symbol From Text

Apr 19, 2010

I have been looking for days for a way to do this but have made no progress.

The text looks fine in php but when displayed by javascript, some of the spaces are shown as an empty square symbol.

I have tried the following to change any unusual character to a space, but it doesn't help. code...

I believe that the character is created by a javascript-based editor when either the delete or backspace key is used to make an edit.

I have this strange symbol in many articles so I need a way to deal with this (the articles display fine when displayed by a php CMS).

I'm using javascript to show a preview of the article as a link tooltip.

View 4 Replies View Related

Regex Matches Periods But Not Square Brackets?

Dec 17, 2010

Can't figure out why the pattern will match a period but not a square bracket.For example, it will match "See Jack run." but not "See [Jack] run.". Just ignores the brackets.

Code:
var title = note_title.value;
// validate periods and brackets

[code]....

View 2 Replies View Related

Creating Square Bullets Based On A Status Column?

Nov 19, 2010

I am adding code to a SharePoint 2007 list where I want a calculated field to be a colored square based on a status column.I have all the code I need to create a colored round bullet, but I would like the bullet to be square or a rectangle.I was not able to find a repalcement for the "bull" in the below code.

arr[i].innerHTML = "<DIV title='Long Term Focus' style='font-weight:bold; font-size:24px; color:green'>•</DIV>";

View 5 Replies View Related

JQuery :: Get The Post Data From Html ,which Contains Square Brackets?

Jan 25, 2011

how do I get the post data from html in jQuery which contains square brackets?

[code]........

View 3 Replies View Related

Drag And Drop A .jpg From Desktop To A Small Square Box On Website?

Mar 20, 2010

is possible with JavaScript to drag and drop a .jpg from your desktop to a small square box on you website. On drop the picture has to upload the file and store it on the server.

View 2 Replies View Related

Battleship Game - Display The Ships In Square Blocks

Dec 20, 2010

I was just looking a the Battleship game by Jason Hotchkiss Is there a way to modify the Javascript so that you can display the ships in square blocks (3X3, 2x2 These could be bases etc.) rather than lines (1x3,1x4)

View 3 Replies View Related

While Loops

Nov 4, 2007

i am trying to do but I have no clue how to write it. Im trying to write a while loop that prints out all of the multiples of 5 between 10 and 95. I just need to know how to write the while loop i got everything else.

View 1 Replies View Related

Newline - Does Not Working After Retrieve A Record That Contains Square Symbol In The Database?

Dec 10, 2009

my javascript does not working after I retrieve a record that contains square symbol in the database. The square symbol should be a newline in a textarea. This is how the record "looks" in the table: [URL]

I am inserting the record using ASP and the value with square symbol is the value from a textarea with newline/enter. After that I retrieve the value using ASP and pass it to javascript and then the page is not working. If I retrieve other record which contain no square symbol then the script is working.

View 1 Replies View Related

Multiple Loops

Feb 6, 2006

I'm my script I've three loops processing a very huge data file. IE & Firefox show a message box after some time saying my script could be infinite looping and give me a chance to stop it.

Is there a way to prevent this dialog box to show up? I'm writing a script used only on a intranet and the final customer should not see the message box.

View 6 Replies View Related

Question About Loops

Jan 12, 2007

Hi, I want to have something like this:

function callme1() {
alert('somestuff');
}

function callme2() {
alert('somestuff');
}

function callme3() {
alert('somestuff');
}

function callme4() {
alert('somestuff');
}

etc.

except, it's going to be created in a loop, like

var x=0;
while (x<10) {

function callme[x]() {
alert('somestuff');
}

x++
}

So, out of that I would like to get 10 callme(1-10 or A-J) functions...
I guess I am lost which way to build this with the placement & parsing
of the variables.

View 3 Replies View Related

How To Break Out Of All Loops

Jun 6, 2009

Is it possible, when you have a loop in a loop, that when the inner loop reaches a certain point, it breaks out of both loops? For example:

[Code]....

The code above will break out of the (b=0;b<=10;b++) loop when b==5, but it will continue to do the a loop. not putting the first loop at all or making the first loop stop at 1): Is there a way to break out of both loops when the if condition is met? (I only ask that you not give a work-around because what I have in mind is much more complicated than this)

View 3 Replies View Related

Using SetInterval In Loops

Dec 15, 2007

i'm scratching my head over achieving similar results with setInterval() function, and how I can keep it from looping infinitely.

I want to do something like this:
var i = 0;
var endTime = now + ((1000*60)*2); // 2 minutes after now
while (now <=endTime) {
i = i + 1;
now = new Date().getTime();
}
document.write("total iterations: " + i);

however you can't do this because of lag issues, so i'll settle for using setinterval on its smallest interval of a millisecond, here is my attempt to translate the above to a setinterval solution:
var endTime = now + ((1000*60)*2); // 2 minutes after now
var intervalID = setInterval(loopFunc(endTime),1);
function loopFunc(endTime,intervalID) {
if (new Date().getTime() <= endTime) {
i = i + 1;
} else {
clearInterval(intervalID);
}}

as you can see I have prolbems figuring out how to stop the interval from continuing to iterate, and passing the interval id, I'm clueless Also I'm clueless on echoing the total iterations via this method.

View 4 Replies View Related

Getting Averages From Loops?

Nov 8, 2009

I want to get averages from a for loop. Let's say I had a # of exams and in that loop I wanted to add the exams up and calculate the average. How would I go about doing this? Is this even possible in a for loop?

View 1 Replies View Related

Using While Loops Incrementer?

Jul 26, 2009

If I were to have a script:

Code JavaScript:
var numbers = [1, 2, 3, 4, 5];
var incrementer = 0;
while (incrementer < numbers.length)
{

[Code]...

View 1 Replies View Related

Calculating Form - Calculate The Square Footage And Cost Of A Vinyl Banner?

Jul 24, 2010

I'm trying to create a four-box form in which the user enters information into the first two boxes,and the program fills the second two boxes in.Basically,I need a form to calculate the square footage and cost of a vinyl banner.In the first text box the user would enter the banner's height.In the second box the user would enter the banner's width.

The third box would multiply the height by the width and display the total square footage of the banner.So far, I have this part down. The following is what I need help with: the fourth box.The fourth box needs to display the cost of the banner. I have a complicated pricing structure. For example:

If the total square feet for the banner is under 12 square feet, the cost is $60.00. If the square feet for the banner is between 13 and 25 square feet. The cost is $4.80/square foot and ect...I believe this would be done using some variation of an IF statement but I can't get it to work.Using this example, what would I add to the form to get this work? The following is the form I have so far which just consists of the calculation of the square feet which is all I've been able to get working.

Code:
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Untitled Document</title>[code].....

View 3 Replies View Related

Cliping A String Without Loops

Jul 20, 2005

I have got a span inside a td of a table. i am trying to clip the
string that exceeds the length of the td and then put three dots
("...") after it so it will show that the text was clipped and when
the mouse hovers above it, it will show the title. now i have managed
to do all the above by puting a span inside the td with the style
overflow:hidden and it all works fine. to add the three dots i have to
clip the string to ten pixels below the length of the td and then add
the dots. i can do it by slicing the string in "string.length-1" each
time and then get the new length of the string with offsetWidth, and
when getting to the right length - add the dots. the problem is that
the slicing is done in a "while" loop, and when having a very long
table it takes too much time. the question is if there is any methods
of clipping the string by pixels or any other method that will shorten
the run time of the script.

p.s.
i tried also having another span with the three dots that is
display:none and when the length exceeds the span length (the length
of the span is set to the td-10px) i change the display to block, but
the second span keeps on droping a line which is not good for me.

View 3 Replies View Related







Copyrights 2005-15 www.BigResource.com, All rights reserved