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


ADVERTISEMENT

NCAA Tournament Bracket Script - Allow The Person Filling Out The Bracket To Click On Their Predicted Winner For Each Game

Mar 3, 2009

I have created a html ncaa tournament bracket for my website in which I hold annual competitions. Recently, my competition has grown and I need a better way for users to submit their brackets. What Im looking for is a way to allow the person filling out the bracket to click on their predicted winner for each game, which will then fill out the bracket as they move through the bracket until the have predicted a national c

View 90 Replies View Related

JQuery :: Obtain Object (key) Names?

Oct 16, 2009

I;m looking for a way to obtain key names from a JSON object:

eg
"options": [
{"Option1" : ["Value1", "Value2"]},
{"Option2" : ["Value3", "Value4"]},
{"Option3" : ["Value5", "Value6"]}

[Code].....

Prototype seems to have a keys method which would achieve what i'm looking for. There are also a few pages which attempt to address the issue with JQuery, such as: [URL] However i was only able to retrieve the numerical index of the array elements using these methods (vs their name).

View 1 Replies View Related

JavaScript Bracket Notation

Aug 8, 2005

I have difficulty understanding how square brackets work in JavaScript and this is causing me difficulty retrieving the values of the options of my Select controls.

My form contains many select boxes. Their names are stored in variables(in this case concat is the select control name) and I have no trouble accessing methods for the select object ie:
document.Allan.elements[concat].selectedIndex;

I would like to get the value of the selectedIndex but I am having difficulty because I don't know the right syntax. I'm looking for a statement like the one that follows but uses variables

document.form.theDay.options[2].text

Could some one help me use the right syntax?

View 3 Replies View Related

Include JSON In Script But Firebug Gives An Error That I'm Missing A Closing Bracket

Oct 12, 2009

I'm trying to include some JSON in my script, but Firebug gives an error that I'm missing a closing bracket, but EVERYTHING matches - brackets, parens, quotes, everything. To make it simple, I've put everything in the onLoad function. Here's the code:

[Code]...

View 3 Replies View Related

RegEx - Grab Function Names And Function Parameter Names From A Text Entry

Sep 15, 2005

I am trying to use a regEx to grab Function names and function parameter names from a text entry.

The script is written in javascript and I expect the functions to be in javascript syntax.

For example the code might look like:

Code:
function myFunction1(param1,param2,param3){
some code
}

function myFunction2();

function myFunction3(param);
Whats the best way to accomplish grabbing the function names and parameters?

Should I be breaking it down into multiple regular expressions?

View 5 Replies View Related

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

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

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 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

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

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

Regular Expression - Match ",.[]" - Cannot Put Them Into The Square Brackets

May 3, 2010

for the character classes [ ], if i want to match ,.[] i cannot put them into the square brackets so how to deal with that? what if the characters are . or ! or ." (<-- combined) it fails if the regexp is [.!(.")] which will treat ( as one of the element. also the book javascript: the definitive guide says that (?=p) requires that the following characters match the pattern p, but do not include those characters in the match. However, the browser failed to figure this out (IE8) i.e. "asd:ert".match(/(?=:)w/) returns null

View 9 Replies View Related

When The Images Rotate In Mozilla In Between The Rotations, Mozilla Browser Adds A Little Colored Square That Represents A Blank Image?

Jul 16, 2009

had this in browsers areas but people told me I should put it here in Javascript because more people here would probably have seen it before and know why it happens. I have basic Javascript that rotates images. I've noticed any kind of Javascript code that rotates images has this same problem only in Mozilla. When the images rotate in Mozilla in between the rotations, Mozilla browser adds a little colored square that represents a blank image that are able to be seen does anyone know why Mozilla Browser adds that? For example when looking at this page in Mozilla can see it. if you know if this is some Mozilla problem with Javascript and images. Doesn't happen with IE and other browsers shows the images only and nothing else.

View 2 Replies View Related

Validate That Name Has 2 Names?

Jan 22, 2009

I have a name field -I want to validate that there is a space in the field - that the user has put in both firstname lastname and not just one

View 7 Replies View Related







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