HTML - Newbie Question Setting Input Field Values By Button
Hey, I'm jst starting to learn html and I was someone could give me an example
of how to create a a simple form with 2 input fields which are set to a value say "hello" in first field and "World" in second field when the button is clicked. Thanks Similar TutorialsHey guys. I've been using local storage for my form and so far it's worked great. Most of the form is simply having the user type in an answer but I have 4 questions that need to be as radio buttons. The problem is I need these radio buttons to be calculative values. I'm pretty sure I've got the 'setting values' part down but how do I 'set item' and 'get item' using local storage? Thanks in advance! Here's what I'm using: HTML Code: <input type="radio" name="length" value=".106" /> Less than 1 year<br /> <input type="radio" name="length" value="0" /> 1-2 years<br /> <input type="radio" name="length" value="-.053" /> More than 2 years<br /> HTML Code: localStorage.setItem("length", this.elements["length"].value); HTML Code: localStorage.getItem("length") So I'm really new to html and I apologize if I'm asking a really obvious/ stupid question. Is there any way that I could make an input button/ form and retrieve the input field value in a specific place? I mean like, is it possible to have the input value sent as a comment in a specific livejournal post? I am trying to write code that would allow me to have a list of products and it would be able to enter the amounts specified in boxes and give you the total once you press the total button.... I have pasted bellow what I have written so far... I am trying to figure out how to make it work... Please help me ! <html> <body> <p> Product 1<INPUT type="text" name="A" value="" onChange="A.value"> Product 2<INPUT type="text" name="B" value="" onChange="B.value"> <input type="submit" value="Total"> <input name="answer" type="text" size="4" maxlength="10" onClick="document.calculator.ans.value+='A.value+B.value'"> </p> </body> </html> Hi I want to do two things: 1) pre populate the input field (the following isn't pre populating in FF) <input type='text' name='txt' id='txt' onFocus='this.select()' VALUE='GIGS' class="formInput" /> CSS: form input {padding-top:5px; font-size:large; background-color:#fff; border:none; height:31px;} 2) make the pre populated text have a different format to the text people write in it. Is it possible? Will it be html, or involve JS? Thanks for your time and help. Shaun Hello, I am new at web design, and frustrated by a Submit button constantly opening a new window instead of moving on in the current window. When coming to this forum to look for answers, I found a Submit button I then researched...and now I am even more confused! There's some code in the screen you see right after you log in, that looks like this: Quote: <script type="text/javascript"> <!-- document.write('<div style="margin-top:0px">'); document.write('<input type="submit" class="button" value=" Proceed " accesskey="s" onclick="window.location=\'http://www.htmlforums.com/f-html-xhtml-4.html/\'; return false" />'); document.write('</div>'); //--> </script> Clicking Submit does indeed move you on within the same window, but my questions a 1. How does this work when...it appears to be commented out! Note the <!-- and -->! And if these aren't commenting code out...then what are they there for? 2. What do all the forward and back slashes mean around the address? (I'm curious about the backslash right before the address, and then the forward and backslash right next to each other afterward) 3. I copied this code into my own page kind of like so: Quote: document.write('<input type="submit" class="button" value="Submit" onclick="window.location=\'newpage.html/\'; return false" />'); Every single time, clicking the button results in a white "This page cannot be displayed" screen--but then refreshing that screen causes the right page to come up! Does anyone know why it won't work the first time? Thanks in advance for any help that anyone can provide! Ok so here is my issue, i am new to web site design and i have a simple project i would like to work on. I am looking to have an entry box with a simple submit button, then i would like the submissions to be displayed below in the order they are submitted. I would also like to limit the number of submissions that show on the page at a given time by creating multiple pages that can be viewed. This seems like a very simple issue but im having trouble finding solutions on the web. Would inserting a java app or some other secondary tool be better? Any help is appreciated -Matt I have created a button which is linked to some JavaScript to dim the screen when it is pressed. using CSS I have changed the image of the button using a graphic. The graphic is a .PNG as it uses transparency but when set the image as the button it has lost all transparency is there anyway to enable the transparency of the .PNG this is the code I am using to do it. Code: <input type="button" onClick="d()" class="button"> Hi, What I have is a search field that searchs from say 200 - 400 and displays anything in between that figure. What I would like it to do is also show results from 400 - 499. Is there away of adding 99 to any value entered so rather than searching for 100 it is searching for 199. But when it gets to 1000's it would need to be 999. Is this possible? If so is it possible cn you do it without displaying the 99 so it shows the figure they entered but in the background its doing the work? Thanks alot Joe Hi, i'm new here and fairly new to html and use a point and click interface for making websites. Can someone help me with an html code that can do the following?: -Its an large input field for visitors to post text and pictures which will then be sent to my email-, to be reviewed for content by me. I will then edit the website with the visitor's content. Sorry if it wasn't clear enough. Thank You, Frostysnow Hi Everyone, I am trying to arrange 2 text input fields and one textarea so that 2 input fields are positioned vertically (one above the other) and textarea is positioned to the right of these 2 input fields. I looked on the web on how to construct rows and tables and scooped up this code where I show how I position these elements: HTML Code: <table border="1"> <tr> <th>Heading</th> <th>Another Heading</th> </tr> <tr> <td>INPUT FIELD</td> <td>TEXTAREA</td> </tr> <tr> <td>INPUT FIELD</td> <td>blank</td> </tr> </table> But the problem is that text area creates a huge vertical space between 2 input fields that is equal to the height of textarea. I need textarea and input fields to be independent of eachother and for textarea height not to affect the vertical space between the 2 input fields. Could somebody, please, tell me how this can be done? I tried to insert additional tables and tried to also create it in DreamWeaver but I am not that knowledgeable with these tools. Please help, Thanks, Victor. i would like the following to be the same size in every browser. i currently have it fitted for firefox. it's almost perfect in internet explorer, but about a pixel too long. as for opera, it is actually a bit too short. any ideas? http://bombfubk.bravehost.com/test.html html: <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" /> <title>Untitled Document</title> <link href="css/test.css" rel="stylesheet" type="text/css" /> </head> <body> <form action="" method="get"> <label for=""> <input name="test" type="text" id="test" value="bfgbfbfbf" size="69" /> </label> </form> </body> </html> css: form { margin: 0px; padding: 0px; } label { background-color: #009933; display: block; padding: 5px; width: 440px; } The page can be found he http://www.trinityacademy.org/alumni/addressBook. You can tab from field to field but can't click on the fields. IF Google toolbar is enabled then you can click on the fields that Google recognizes for autofil but not on the fields it does not. I am baffled by this one. Any ideas??? How do I prefill an input field in a form? I don't mean "value=hello" I mean have a light gray text inside that says "enter your first name" and then when the user starts typing that text disappears. I thought there was an html tag that did this (or a form tag like type=""). I hope it doesn't require CSS... thanks! Hi all, I have a text input field, and I would like it to autocomplete from a list. For example the input field is for cities, and when the user types 'lon' I want it to automatically show a list of cities that have lon in the beginning of it's name, or if there are no others for it to autocomplete for the user. It doesn't necessarily have to be a text input element, it can be something else I just don't know what to use or how to go about it. Anyone got any ideas? Hi Guys I have a text input field in a form that has data in it from a previous entries. Is there something i can do that ensures the field is empty when the form is pulled up? Thanks everyone I have some fields and a Select option, I want to add a new field if I select "Add" option, and remove field when I select "Remove" option, can I do it in very simple JavaScript? Hi All, I'm not new to HTML, but I heard that with HTML 5 you can partially fill out a form, leave the page and come back to the page and the form will still have the data on it that was previously entered into it without commiting that data to a database. Does anyone know anything about this and some links I can go to learn more about it? Thanks, CalvinC This should be so simple task but no. How can I pass input field value to the function? What I read from the input field, as soon as I press the "Save results" the value of the input field should be passed within the function. All I can do is puit 'stuffhere' and it works but simply can not manage to retriveve the input data! <form name="inputData"> <input type="text" name="userName" size="32"/><br /> <a href="#" OnClick="SetText('resultHandler','Username',' stuffhere ');SendMessageToTheObject('resultHandler','saveResult');return true;"><font color="red">[Save result]</font></a> </form> Can someone tell me why there's a black border around the "PACK SIX" tile at the bottom of my page when I try to apply a href link to it? Losing my mind here. Thanks here's the link: https://www.bogeypro.com/index.asp?P...=Custom&ID=122 Hi all, I'm feel really stupid but I have a very simple question. I need to revert the colors of this page: http://pastehtml.com/view/bb17uy02t.html The background should be black and the text white. Can someone please help me out? Thanks in advance. Kent |