Using DOM in IE, how can I loop through FORMs and access FORM elements
in a specific form? For example, www.hotmail.com has about 13 forms.
I believe the one displayed is dependent on the URL. If I want to
access the submit button of the visible form, which is usually the last
one, how is that done?
Currently, I look for type=submit using DOM but it doesn't find
anything and only loops through the first FORM elements.
I am using MYSQL to store articles. I wanted to present the articles in order by id, then let the user choose one of them and send the id of the article to another php page for processing, using ajax. To do so i have placed a simple form in the articles. like so:
$result = mysql_query("SELECT * FROM articles ORDER BY id DESC") or die(mysql_error()); while($row = mysql_fetch_array($result)){
I want to make few forms but 1 submit button. I want to do 1 page , 5 forms , 1 submit button so when i click on the submit button it will send the 5 forms as 1 form.
Where the inputs sum1 and sum2 are text fields you put whatever numbers you want in. That works fine. Great. Now what I'm having trouble with is modifying the code so that it will add one form with an input number with a form that spits out a randomly generated number.
This is what I'm using for my random number generator. So basically I want to be able to put, say, 5, into the input text field above this. And then click on the d20 button to get a random number, say, 15, and then have the first code add the inputted 5 with the randomly generated 15.
I have been looking at this code for two evenings now, and rewrote it 4 times already. It started out as jQuery code and now it's just concatenating strings together.
What I'm trying to do: Build a menu/outline using unordered lists from a multidimensional array.
What is happening: Inside the buildMenuHTML function, if I call buildMenuHTML, the for loop only happens once (i.e. only for 'i' having a value of '0'.) If I comment out the call to itself, it goes through the for loop all 3 times, but obviously the submenus are not created.
I'm looking to send a loop variable (i) to a function inside the loop, but I can't seem to get it to use the value I want, it keeps making it a reference of i and therefore the function is always called using the last value of i rather than the one it was set with.
So if i have 5 Tabs then Tab 1, when clicked, should call DefaultTabClick(0) and so on rather than always using 4 for any of the tabs.
I have the code below, how could it be modified to loop over and over and reload the xml file each time. Flow would be: load xml, run thruogh code to display each xml node one at a time, when reach last node, start all over, reloading xml file,
I am doing some studying and we was to create a small loop using either the for loop, while loop or do while loop. I chose to do the for loop because it was easier to understand, but I want to know how to do the same using the while loop. Here is the for loop I have, but I cant figure out how to change to while loop.
for (var i = 0; i < 5; ++i) { for (var j = i; j < 5; ++j) {
I've been trying to teach myself JavaScript via a book and a number of JavaScript Tutorials Online. I have more understanding of what I am doing, although definetly not has much as what I have read on this newsgroup.
I'm trying to learn a new skill in order to hopefully get a job. My job went to india while I was out on medical leave (carpal tunnel.)
My question, I have two JavaScript / Htm pages identical to the one below. I'm trying to figure out how I could put both of these "identical" javascript pages into One HTM page. But I am clueless as to what to look for and or how to proceed. I'm thinking that I need to somehow add a checkbox_checker() and a checkbox_checker(2) or something like this.
I've looked at the "For Dummies" book on JavaScript, and my Beginning JavaScript Book as well as Google'd. Funny thing is though you have to have enough "knowledge" of JavaScript to know what to look for....
Is it possible to access the value of a radio button or change a radio button to enabled/disabled without using the forms tags<FORM></FORM>? In other words is the forms tag required for these actions?
i'm trying to use javascript to change the content of a textbox in a different frame.
by clicking on a 'folder' link in 'leftFrame' i want to put the value assigned by that link into the 'folderName' textbox in the 'uploadForm' form in 'mainFrame'. i'm doing this as...
this works perfectly fine with IE and Safari on my Mac OS X machine and IE 6 on my PC laptop but anything Mozilla-based on either machine gives me an error i just can't seem to get round...
I'm working on a simple Twitter app that checks whether a user is following another user, but I'm having trouble picking up on the inputted values in my form.
I've got this form on my page:
And using the form plugin, here's my JS:
The only thing that's being alerted is "username, username" and it's not registered text inputted into the fields at all.
i need to be able to select the year and according to the year only be able to select certin months.
i was thinking an if statement but (if year = 2006 then months= jan,mar,dec) sorta thing but i cant get that part working. any direction would be nice.
maybe there's an easier/different way to do this?
<script language="javascript">
function downloadForm(formMonth,formYear){ month = document.getElementById(formMonth).value; year= document.getElementById(formYear).value; location.href = "/pdf/qa/customer-satisfaction-leaderboards-" + year + "-" + month +".pdf"; }</script> Code:
I am working on creating a project and I need some help. I have 2 form boxes, one that displays text, and one that does not. What my goal is, is to have someone type the text displayed in the top form in the bottom one and have the word that they are typing highlighted in the display text. If someone type the word wrong, it will be red text in the bottom form. Code:
I have to create a dynamic HTML page that actually contains two separate HTML forms.Can anyone tell me how can I create two forms in a single HTML page.
I'm not a JS person, so hopefully this'll be nice an easy .
The follwoing bit of code:
Code: <script language="javascript"> // if form exists , set cursor in first input field function focusonform() { if (document.forms[0]) { document.forms[0].elements[0].focus(); } else {window.focus();} } </script>
This appears to work fine on a page with no forms using Mozilla 1.0, IE6 on win2000. But NOT on IE6 on XP - I get the following message:
A Runtime Error has occured. Do you wish to Debug? Line: 70 Error: 'document.forms.0.elements.0'
I was wondering, I have several pages with different forms, these pages are in a frameset. I was wondering is there a Javscript I can put in a .js file that will set focus to the first form element in each page with out having to write a script for each page?
I am trying to create a form (a quiz to be exact) and I know how to create one in php. The only problem with this is that the location that I am planning on installing the quiz does not allow me php access, a cgi-bin or even internet access . Iam able to use html pages from a location stored on the desktop or in a network folder.
My idea is to have the first page be the actual quiz with the users selecting the answers. The following page (whether its a popup, text file, or a new page) would be where the answers are displayed and then ultimately printed to paper. Most of the scripts that I have found that would do something similar are email style scripts (I am unable to use this method)
This is what I have in php and is the type of format I am looking for in javascript. (I'm not very proficient in php as I just started and I have no clue about javascript) Code: