I have this code that I want to make it so that it's not inline javascript but my javascript skills are completely lacking. Could anyone spare a minute to walk me through it?
As you can see I am simply creating a place holder for the input field, so that it says "Search" inside of it until someone clicks it. Unfortunately I have very little experience not inlining my Javascript.
This works fine in netscape but IE won't do it. I have a div which contains some links and a thumbnail. What's supposed to happen is when you click the thumbnail the links disapear and the now invisible div is resized moving everything below it. In IE it only resizes as small as the size of the dive plus the size of the links. Code:
i am creating a simple form validation script where i will ask for the username, password and email of a user. when an error is created, a text will be displayed beside the textbox. but i want to know how i can add colors to the textbox if there is an error.
I am working on a javascript for my blackberry. I am trying to capture the latitude and longitude of that phone. I am able to get the coordinates in an alert box but am having a little trouble writing it to a form input field.
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "[URL]"> <html xmlns="[URL]" xml:lang="en" lang="en"> <head><title>GPS Testing</title> </head><body> <script type="text/javascript"> if(blackberry.location.GPSSupported){ document.write("Your device supports GPS locating"); blackberry.location.onLocationUpdate(window.alert("Latitude: " + blackberry.location.latitude + " Longitude: " + blackberry.location.longitude)); var lat = blackberry.location.latitude(); var lng = blackberry.location.longitude(); blackberry.location.refreshLocation(); document.write(lat); } </script></body></html>
I am only able to test with Blackberry. I was trying to create a couple of variables with the "var lat =" and var lng =". With this script I get the alert window and when I click ok it writes "Your device supports ...".
i have a form with a 'name', 'date', 'type', 'style', 'color' and 'result' field.let's say the user inputs "jones" in the name field, "8/1/2011" in the date field, "new" in the type field, and 'modern' in the style field.i want the 'result' field to take a look at the 'name' field, and if the 'name' field has a particular text, let's say (in this case) "jones", the javascript code will then place the contents of 'date', 'type' and 'style' fields, along with hardwired text like "the information you are looking for is 'date', 'type' and 'style'" into the 'result' field.
I am having a form with two input fields. I want to enter some text in the first input field and then the second field should get the same text. Is there a simple way (maybe a plugin) to do this with jQuery? It would be perfect if I even could output all these input fields values as normal text in <p> or <li> tags.
I have this script that when run will search a form field (pricenum) and make sure that only a period or numbers are entered. If anything else is found, the script should clear the field, display an alert and then return the cursor to that form field. Everything works perfect except that the cursor will not return to the "pricenum" field after the alert popup is closed.
I'm trying to create a multi-field in-place editing: basically I have a series of values that I'd like to display as a text but when I click a specific button those texts have to become text-fields.
I have created a snippet of javascript code that will do the following:
1. read the window URL 2. depending on the window URL, a word will be placed into a hidden form field. 3. Person submits form...etc., etc.
Here is what I have.
Let's say that I have a single landing page with a simple form on it. I would like to reference the referred URL by pulling a part of the window URL into a hidden field of the form. Let's say the three URLs are:
[URL]
I have created a javascript that takes the exact URL and check for equality. If the URL is equal, it will place the corresponding id into the hidden form field. See my code below.
<script type="text/javascript"> var lead_source = window.location.href { if (lead_source == "http://www.whatever.com/index.htm?id=ref1")
[Code]....
What I am looking to do is modify the code to only look at the "id" variable, not the entire URL. That way, if I add any additional items to the URL I will not have to change the code. I guess I am looking for an extra step of parsing the URL...maybe.
what i want to do is have a selection from 'tst' trigger an input into 'choose' from the data inputted into the 'fname' and 'lname' fields.
for example, i want option '1', when selected to draw the input from 'fname' and place it into 'choose'
or i might want to select the data in 'lname' instead, so i will tie option 2 to it, so when the user selects option 2 the contents of 'lname' go into 'choose' instead.
I am trying to make some dynamic effect to a HTML page using JQuery.<br/> 1.<br/> When the user clicks a Radio field, the field will be highlighted.<br/> 2.<br/> When the user clicks the Radio 'Man', <br/>a Input text box will be provided immeditely just below it.
Here is my simple HTML page, but I don't know how to do with the JQuery part:
So I have to ask some stupid questions and make sure that there is not something wrong in this simple syntax. I am trying to get input field attributes type and tagname by field ID. Heres the code..
Code JavaScript: var type = $('#' + input_id).attr('type'); var tag = $('#' + input_id).attr('tagName');
When I look in firebug I see there is the correct ID in input_id variable and that the input field with that id exists. But for tag and type variables I just get 'undefined' for reason unknown.. syntax is correct or?
I'm trying to find a code which would take the input value entered in a form field and on click direct you to a page which corresponds with what was entered.So for example:
Enter "5" in field.
Click Submit.
Page opens up (which in fact would be an html file on my server called... 5.html)( i would want to create 10 pages for values entered from 1-10... each value having a unique result when entered and clicked)how to put this all together, i've been searching everywhere.
I want to create fileds on my form that can not be manually edited through the UI of the form. Instead the (visible) content is changed through changes on other parts of the form.
e.g. making a selection from a list changes the content of the field mentioned above. I don't know the html code to create such a field on my form. Can anyone help me out?
I have a php script that lists some items which can be checked or unchecked. Now, I am trying to make a javascript that writes a comment field in a certain "span" - comm_'.$i.', where $i starts from 0 - if the check box is already checked (info retrieved from the database) or if the user checks the check box (when the user unchecks the check box the comment field should disappear). The problem is that I am unable to make it work properly (when I check or uncheck a box it doesn't work at all), I mean it only works for the element above, so if box_1 is checked it can only create the comment field in comm_0.
The error I get is - this is similar to the errors I get when checking and unchecking a check box: Message: 'null' is null or not an object Line: 64 (this would be line comSpc.innerHTML = 'something1';) Char: 4 Code: 0
How would I go about creating a new arrary which consists of the values for every text input within a form? The array would need to be created dynamically when the function is called (by clicking a button or whatever). Is this possible?
I am trying to create a js script that will prompt the user for a times table (example the 5 times table, the 7 times table, etc.) & prompt the user for 2 more values; the 'start' number and 'end' number. So there would be 3 numbers total the user must input. The script should present a 'warning' message if the user inputs letters or negative numbers. I have come very close to getting it too work but can't quite get past the last hurdle. Upon entering the 3 numbers, the output should look similar to this: (the 5 times table starting with 1 and ending with 12)
I use a Time Date Picker Javascript code [URL]. It works fine with a placement problem. When you click one of the last pair input fields on the page, a drop-down list will appear from the input field. In my case, the drop-down list shows on the bottom of a page instead. I can't find the code controls the location of the list.