I am currently designing an HTML page with a form with a post method. The page is calling itself so with the details that are passed will vary how the page will look i.e. number of results from the sql query that is being run. I'm trying to catch these using a javascript function which is:
var qsParm = new Array(); function qs() { var query = window.location.search.substring(1); document.writeln(query); var parms = query.split('&'); for (var i=0; i<parms.length; i++) { var pos = parms[i].indexOf('='); if (pos > 0) { var key = parms[i].substring(0,pos); var val = parms[i].substring(pos+1); qsParm[key] = val; } } }
and then just calling the array to get the value, in this case qsParm['num_res']. The above function doesnt work for post but does for get. I'm fairly new to javascript and am assuming this line is at fault:
I am trying to create an HTML form in which user will enter different items (he wants to purchase) in text fields. One text field is used for one item. Now it is not known in advance how much items the user will purchase so we cannot decide the total text fields required in advance. Is is possible to increase the number of text fields (using JavaScript) one by one if the user requires more fields
I'm having some trouble naming variables in javascript. Actually, my html has multiple form names (form, form1, form2, etc..., and im just having trouble understanding how to access elements within.For example: I get error:Message: 'document.forms.form.bname' is null or not an objectWhen I use the following code:
var bname = document.forms["form"].bname.value; And when I try this: var bname = document.form.bname.value;
I am a newbie trying to generate an alert message when a user leaves a username filed blank in an html form using an external javascript. Following is the code for html file.
[Code]....
However, if I swap the positions of the username and first name i.e. place the first name before the username, I do get an alert message if the first name is left empty. I do not wish to hijack an existing thread. Please let me know if there is an existing thread on this issue..(I could not find one).
This question may appear opposite of most, but I'm learning JS using a book and I can't understand why/how this particular code works. I'm working on simply retrieving and passing information to and from html forms. This is a very simple script that will change what is selected in the drop down box depending on a button push.
Here is the script: Code: function flip(pizzatype) { if (pizzatype.value == "Veggie Special") { document.forms["pizzaform"].topping.value = "veggies"; } else if (pizzatype.value == "Meat Special") { document.forms["pizzaform"].topping.value = "meat"; } else if (pizzatype.value == "Hawaiian") { document.forms["pizzaform"].topping.value = "hampineapple"; }}
The way I see it is the button onclick will call the flip function and pass it a var, for example "veggiespecial". I understand the code that will perform the actual change on the drop down menu. What I don't understand is the if statement. if(pizzatype.value == "veggiespecial")... Shouldn't it be just (pizzatype == "veggiespecial")? Why does it have to be pizzatype.value? Where the heck does the .value come from???
I have come in need of assistance in guiding me in the right direction. My intentions are to create a web-based page where one can select from a few drop down menu's, and enter a few select pieces of information. This information would then be logged for later purposes, when the user chooses to retrieve this information (during the initial usage, no long term storage) in the format of a report.
I have a web page with two forms, when I click the button on one of the forms, the onclick event goes to a javascript that emails the first form and then the second form. This is correct, this is the way I want this to work. It's simple, it's easy, it works!
However, it only works in FireFox and Internet Explorer, it will not work in Google Chrome browser.
I've spent many hours trying lots of various ways to implement this so I'm not interested in speculating about possible solutions that might work, I've already tried too many of those.
Also, it needs to work this way, not combining the forms, etc.
Does anyone have any tried and tested solutions that work with Chrome? code...
I know that Javascript is client side, but I'd like to know the best way to populate HTML drop downs in real time based on information typed in the other HTML form fields with information found on the server as opposed to the client.For instance if a user wants to select certain files located in a directory on the server, as they type in the pathname supposedly containing the files the drop downs continually refresh themselves with the server files listed in that directory (if it exists, and apache has permissions to see what's inside) as if it was showing client files instead.
What would be nice is if my browser could continually query the server for some of its private information and not have to refresh itself to obtain it, whether that means the server-side would have to continually refresh itself makes no difference to me as long as the client-side doesn't have to. But I guess this is not possible because no matter what you would have to at least refresh the client-side page once?Submitting the form to a CGI or PHP script would not work because I need this functionality to help populate the form BEFORE I send it.I would like to not have to press a button to update the form every time I change the pathname and need to update the drop downs since this would be annoying.
function validate_form(){ if(regform.reguser.value == ""){ alert("Please completed the selected box");[code]....
to validate a simple registration form, however I initially tried to streamline this function by cycling through an array using a loop to point to various input elements in the HTML page itself. I found that when trying to use a variable in the aforementioned if statements the javascript failed to work i.e.
var test = "reguser"; if(regform.test.value = ""){ }
I know the javascript is looking for the input element "test" instead of "reguser" but is there any way I can force it to look for the contents of the variable.
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.
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'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.