I have an array for of input names. Input1 , input 2 etc. Can I pass the input names in a loop like document.all[input].value="xxxx"
The problem is document.all cannot be used in Safari/firefox, I tried using document.getElementById but my inputs do have any IDs. is there any way of accomplishing thsse.?
i'm using the slider ui and some hidden input fields to store percentage values in it. I'm having no issue with the plugin itself but with the way jquery gets it's html elements, that's why i'm posting here.
On change the sliders change the value of that hidden field so i can submit the form to get the data into the database.
My problem is that i have multiple sliders on one site and because of that multiple hidden input fields.
All have their own name like "percent[17]" or so.
I'm using this code to get the hidden inputs and change their values: $("input[name=percent[17]]").val(ui.value); I'm hundred percent sure it worked but now it's not working anymore. :(
Should it work or is that "query" to find the html element wrong?
In a form, I have multiple checkboxes which represent products whose values are the product prices and names are the product names. When a user clicks submit the next page processes it for cart/purchase purposes.
I need to pass the names of each checkbox to the next page as an array, and it seemed the best way to accomplish this would be to have a hidden input which automatically generates that array in the page then gets passed to the next (via POST) so the application can manipulate the data.
My server-side language is PHP on Codeigniter.
Here's the code: <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en"> <head>
<script type='text/javascript'> <!-- panelsArray = new Array("form0","form3","form4","form5","blotter"); var blotter = new Array(འ',騦',魒',饼','block',''); var form0 = new Array(餢',ཱི',骹',餑','block',''); var form3 = new Array(鰌',ྀ',馅',飣','block',''); var form4 = new Array(鮵',髧',駨',飶','block',''); var form5 = new Array(Ɔ',Ɔ',魽',饻','block',''); // --> </script>
and I want to parse the first array and then within that loop I want to get the variable name from the 'outer' array and then reference the contents of the array with that name... I was trying to do the following but it doesn't work, I'm obviously missing something about transmogrifying the text "form0" into a variable name...
I'm still struggling with creating a properly formatted form. This problem it two-fold. The first part isn't strictly a javascript problem, but I've included it here because it relates to the second part, which is:
1. Given the form below, how should I structure the input names to get an array like that at bottom?
2. The scripts are used to provide running totals and subtotals. They're fun - try them! But how should I modify these scripts so that they can continue to work with the amended naming policy?
I'm trying to make a form where a user can check boxes, and depending on if certain boxes have been checked, other boxes will grey out or un-grey.
What the code does is look at the checkbox name and depending on the family (f), and whether or not the box is a child (c) or a parent (p), the code will grey out certain boxes.
Now that I've sat back and thought about the code, I think there is probably a better way to achieve what I want. Maybe I can specify checkbox names instead of doing the parent child hierarchy that i'm trying. Code:
I am having difficulty using javascript to validate form fields with whitespaces in the element names (ex: First Name, Last Name).
here's a code snippet: ### function validate(formObj) { if (document.form1.Payment Method.checked){ do something here...} ###
the problem is that javascript won't read the element "Payment Method" unless i mash the name into one word. (i don't want to do that because i later use the element names to provide a printable customer receipt
i tried using the ascii octal number for a whitespace in the above code (...form1.Payment40Method.checked...), but to no avail.
I cant control the function between the outer and inner fuction. as I use a top.out1() in the children object. I cannot call the function run within the $(document).ready(function() { function inner1(){alert("alertinner")}} the question is:
1.How can I call the function inner() directly by the object children svg page?
2.How can I call the function inner() by the function outer1()?
3.How can I call the function outer2() by the function inner()?
<script type="text/javascript"> function outer1(){ alert("outer1alert"); }
I'm trying to build a cascading menu in javascript I got as far as this ; all I want to do is Re-draw the whole page when the link is clicked however I get an object required message the second time the link is clicked (I,m using IE 5) Code:
I have a server-side ASP script that dynamically creates an input form from a database table. The table contains a field name, the table where values are stored, type of input control, value for a label, etc.
What I need to do is create a JS validation routine that will check each control for valid input, regardless of what the control name is. If it is a "select", it needs to verify the index is > 1. If it is an "input", it needs to check that it isnt't empty, etc.
Using known fields, I usually do something like this (page name is "me.asp":
I adapted Bresenham line drawing algorithm to draw a dashed line. I want to count the number of dashes. The dashes extend from one city on a map to another city. I don't want the dashes to obscure the city marker which is a small black dot, so I added some logic to skip dashes at the start of the line and at the end of the line. But this logic is confounding my attempt to count the dashes and I haven't been able to figure out why. The function should return the number of dashes as 'count'.
My preview.php file which uses a watermark plugin is not loading correctly in IE 9, when I click the load button. It works well with other browsers. I have a posthttp2.php file
I'm trying to build a store locator and trying to figure out how to pass an input value from one page to another page. User would input their zipcode or address in a form on one page and the map and locations would be called on another page using the input. I'm using ehound store locator platform (sample - here -> [URL] The map/locator script is this
[Code]...
I've looked around on passing inputs via php and such, but this script seems to call on javascript as well and I'm having trouble implementing anything that works.
I need a JavaScript code that can get type , name & id from my example url and pass them to a form input value.
Code: <form name="myform" > <input type = "text" name = "type" value = type =111 > <input type = "text" name = "name" value = name=jack > <input type = "text" name = "id" value = id=2 > </form>
i can't change my form input tag properties . i don't have access to it's value notice that i need a java-script code that it don't use a method in input tags and it can change the value of that input.
( i am creating a form using CCK in drupal & i don't want to use views module for some reason)
I have a PHP based calendar where the cells will change color depending on the number of clicks.. this all works fine, but is pointless if I can't send the outcome along in an email. I can do this with PHP but first need to get the values into a hidden field. This is what I have:
[Code]....
All I'm trying to do is populate value with either 'available', 'not available', 'working' or 'not set'... however, it is worth noting that each cell may have a different value, e.g. 1 cell might be working while the other is not available... so i need to pass the values of all the cells.
So I have a basic form and I'm unsure of how I can pass the current URL of the page to that form so that it may be processed in a PHP file and return the user to the current page. Given the nature of what I'm writing this must be done in Javascript and not PHP. However I'm not really understanding the information I'm finding online.
I have a PHP based calendar where the cells will change color depending on the number of clicks.. this all works fine, but is pointless if I can't send the outcome along in an email. I can do this with PHP but first need to get the values into a hidden field.This is what I have:
Code: <script type="text/javascript"> function countClicks (obj){
I'm using Keith Wood's jquery plugin to produce some graphs for my site. Though I've been able to produce "static" ones, I'd like the user to be able to input a new constant and then have my graph update it according to what they enter. I'm not quite sure how to add the value that the user inputs to my linear function below. So far I have:
I have a bunch of forms in my page, and want to pass a reference to the current form to a javascript function - when, say, a user clicks on a particular element. Normally, within any type of input field, I'd just add something like this:
onclick="my_function(this.form)"
Then, in my_function( form ) I could refer to form. No worries.
But here's the interesting bit. I also want to run the same function when the user clicks on any <a> tag within a form, like:
I have a textbox and button in html, and when something is fill in the textbox, i want to pass the value of the textbox to ajax, data: '{"name": theName}', I couldn't seems to get it to work.
Of couse when i use string value, it works just perfectly for example: data: '{"name": "Joe"}',
I have a page where you can dress someone up in silly clothes using a skeleton image, and several items of clothing as gifs in dragable layers. Code:
How can I use a bit of j'script to grab the X and Y values of each layer and then put them in to a load of hidden form fields?
I then intend on having the user click the submit button when they've put all the stupid clothes in the wrong places... and saving the results in a database.