HTML - Input Box Help!
hey guys, im really new to html.
there is probably something really obvious that im missing here but, say i have and input box in html, what would i do in the onchange event to alert what the user typed in: <input type="text" onchange=(??!!)> for instance, if there was an input box and the user typed in "hello" into it, what would i put in the onchange event to alert "hello" Hope this makes sense! Thanks Similar TutorialsOk 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 Hi What is wrong with this, it can't post text only post checkbox <html> <head> </head> <body> <FORM action="http://localhost:8182/items" method="post"> <P> <LABEL for="firstname">First name: </LABEL> <input type="text" value = "Hamada" id="firstname"><BR> <LABEL for="lastname">Last name: </LABEL> <input type="text" value = "I hate my life" id="lastname"><BR> <LABEL for="email">email: </LABEL> <input type="text" id="email" value = "I hate you"><BR> <INPUT type="radio" name="sex" value="Male"> Male<BR> <INPUT type="radio" name="sex" value="Female"> Female<BR> <input type="submit" value="Submit"> <INPUT type="reset"> </P> </FORM> </body> </html> Thanks Hi, I'm a newbie. I would like to know how do I display 2 labels and both inputs in the same row as shown in the attachment like state followed by input field followed by label for zip and followed by input within the same row of table in a form. Thanks in advance yls how to create a input-box with different 2 border color top and left........... how to give margin or padding to the text inside in the input box? How do i save input from a client into a file on my computer? Code: <html> <head> <title>Register</title> </head> <form> Username: <input type="text" name="username"> <br> Password: <input type="text" name="password"> <br> Retype Password: <input type="text" name="confirmpass"> <br> <input type="submit" value="Submit"> </form> </html> - End - How do I store the input from the user? (username,password,confirmpass) Thank you -HTMLMW how i do. I have created a form and I want that every time you click the button vote on the text join a number more <form name="Vote"> <input type="text" value="" name="sky"> <input type="hidden" value="1" name="blue"> <input type="button" value="Vote" onClick="document.Vote.sky.value =(document.Vote.blue.value)"> </form> Thanks How increase the value? I'm sure this has been answered numerous times before but I'm not sure what to type into a search to find it. Regardless, I'm sure it's an easy answer. I was just curious on how I could take a person's name for instance in a standard input text box and then show it later in text later on the page? So, take your name "Bob" for instance, and then substitute the name "Bob" in my text later. Thank you! Hello guys. I'm kinda new to this so please pardon me if it sounds brainless. I need a simple solution (in fact nothing more than a form that sends data to my email when OK is clicked) for my website. It should be like: --------------------- Enter your name: Enter your email: Enter your mobile number (optional): Select your product:[drop-down list] Quantity: Select delivery method:[drop-down list] OK --------------------- Then thereafter the information is sent to my email. There'll be a pop up if there are blanks other than the mobile number (or we can completely ignore that if this is not possible) and returns to the page instead of sending. Is this possible? Encryption would be nice but is not necessary since this is very low-end application. Cheerio, Bill. I wanted to make a form that, by email, submits an email adress. but instead of just saying <input type="text" name="email">, i want it so is has to be a account at any email host that i want. i would make a text box and call it "user" and a email dropdown list with email server, e.g. gmail, yahoo etc. I would receve an email like user="someemail"&email="yahoo.com". i want it as email="someemail@yahoo.com". heres the code: HTML Code: <form action="mailto:me@email.com"> <BR><input type="text" name="accountname" value="your email adress"> <BR><select name="host"> <option value="@gmail.com">Gmail.com</option> <option value="@yahoo.com">yahoo.com</option> <option value="@hotmail.com">hotmail.com</option> </select> Thnks, Aarmale I am creating a small crm and would like to have the input fields look like regular text until clicked on. At that point I would like the input field to be edited....is this possible? For example... First name : James would appear like this....when clicking on James, it puts a input box so you are able to edit the field. I will be using php. Hi Ive done this before but cant remember now. I need to pass a search query but also include another variable in the url but cant remember how to include the extra variable. So the action is SearchResults.php The query is Query And I need to include &siteID=0 So the full url would be SearchResults.php&Query=foobar&siteID=0 My form is like so <form method="get" action="SearchResults.php"> <fieldset> <input type="text" id="seach-text" name="Query" value="" /> <input type="submit" id="search-submit" value="Search" /> </fieldset> </form> To recap how do I include &siteID=0 Thanks! This might have already been answered but I need html code for this. "User input field" redirects to www.website.com/"user input".aspx Simple I think but I am going crazy trying to get it to work. I would like it to open to the page not a frame. Thanks Pete I'm trying to put default values in my Input fields, which are text fields, of course, but I have numeric input values so I want them on the right. Is there any way to do this? here's a snippet of my code so's you can see what I mean: <form action="" id="calculate_form"> <div> <table style="width: 937px; height: 438px;"> <tbody> <tr> <td> Height: (Metres) </td> <td style="text-align: center; vertical-align: top;"> <p><input value="0" name="height" id="height" /> </p> </td> <td> Cement Price/20kg Bag<br /> </td> <td><input value="7" name="cementprice" id="cementprice" /></td> </tr> <tr> <td>Breadth: (Metres)</td> <td style="text-align: center; vertical-align: middle;"> <p><input value="0" name="breadth" id="breadth" /> and so on........... Perhaps it can't be done in HTML? In that case, what could it be done in? i've got a javascript script on this page, to do the calcs. hi guys again. ive tried everything to validate this box but i cant for the life of me work out how?! i just want it to pop up an alert if the user hasnt entered their name in my_form.visitor_name. i think its somethin to do with the way ive used it in my javascript but here it is, and here's the full site if it helps, thanks www.samsharples.com Code: window.onload = init; function init() { var el = document.getElementById("welcome_message"); var username=getCookie('username'); document.getElementById("my_form").onsubmit = parse_form; el.innerHTML = "<p class=\"welcome\">Welcome to the football quiz " + username + "</p>"; } function parse_form() { var visitor_name = document.getElementById("visitor_name").value; var el = document.getElementById("welcome_message"); if (visitor_name || (username!=null && username!="")) { el.innerHTML = "<p class=\"welcome\">Welcome to the football quiz " + visitor_name + "</p>"; setCookie('username',visitor_name,365); } return false; } function getCookie(c_name) { if (document.cookie.length>0) { c_start=document.cookie.indexOf(c_name + "="); if (c_start!=-1) { c_start=c_start + c_name.length+1; c_end=document.cookie.indexOf(";",c_start); if (c_end==-1) c_end=document.cookie.length; return unescape(document.cookie.substring(c_start,c_end)); } } return ""; } function setCookie(c_name,value,expiredays) { var exdate=new Date(); exdate.setDate(exdate.getDate()+expiredays); document.cookie=c_name+ "=" +escape(value)+ ((expiredays==null) ? "" : ";expires="+exdate.toGMTString()); } // -------------------end name---------------------- // function quiz_message() { document.getElementById("results").innerHTML = "Complete the quiz and your scores will appear here!...."; } // var ans = new Array; var done = new Array; var yourAns = new Array; var explainAnswer = new Array; var score = 0; ans[1] = "b"; ans[2] = "b"; ans[3] = "a"; ans[4] = "c"; ans[5] = "b"; explainAnswer[1]="Roar is Blackburn's mascot<br/><br/>"; explainAnswer[2]="John Coleman is Accrington's manager<br/><br/>"; explainAnswer[3]="The picture was infact David Beckham<br/><br/>"; explainAnswer[4]="The golden oldie Ryan Giggs was PFA Player of the year<br/><br/>"; explainAnswer[5]="The top scorer was Thiery Henry<br/>"; function Engine(question, answer) { yourAns[question]=answer; } function Score(){ var answerText = "How did you do?<br/>\n------------------------------------------------------------------------\n<br/>"; for(i=1;i<=5;i++){ answerText=answerText+"\nQuestion :"+i+"\n"; if(ans[i]!=yourAns[i]){ answerText=answerText+"\n<img src=\"images/wrong.jpg\" />The correct answer was " +ans[i] + "\n"+explainAnswer[i]+"\n"; } else{ answerText=answerText+" \n<img src=\"images/right.jpg\" />Correct!<br/> \n"; score++; } } answerText=answerText+"\nYour total score is : <a class=\"score\">"+score+"</a>\n"; var username=getCookie('username'); //now score the user if(score<=0){ answerText=answerText+"You need to learn some more " +username+ "."; } if(score>=1 && score <=1){ answerText=answerText+"My grandma could do better than that " +username+ "!"; } if(score>=2 && score <=2){ answerText=answerText+"Bit more practice needed " +username+ "."; } if(score>=3 && score <=3){ answerText=answerText+"Neither bad or birlliant. Good effort " +username+ "."; } if(score>=4 && score <=4){ answerText=answerText+"4/5 aint bad " +username+ "!"; } if(score>4){ answerText=answerText+"You are a footballing expert " +username+ "!!"; } document.getElementById("results").innerHTML = answerText; } function Score_female(){ var answerText = "<h5>How did you do?<br/>\n------------------------------------------------------------------------\n<br/>"; for(i=1;i<=5;i++){ answerText=answerText+"\nQuestion :"+i+"\n"; if(ans[i]!=yourAns[i]){ answerText=answerText+"\n<img src=\"images/wrong.jpg\" />The correct answer was " +ans[i] + "\n"+explainAnswer[i]+"\n"; } else{ answerText=answerText+" \n<img src=\"images/right.jpg\" />Correct!<br/> \n"; score++; } } answerText=answerText+"\nYour total score is : <a class=\"score\">"+score+"</a>\n"; var username=getCookie('username'); //now score the user if(score<=0){ answerText=answerText+"You need to learn some more " +username+ ".</h5>"; } if(score>=1 && score <=1){ answerText=answerText+"My grandma could do better than that " +username+ "!</h5>"; } if(score>=2 && score <=2){ answerText=answerText+"Bit more practice needed " +username+ "."; } if(score>=3 && score <=3){ answerText=answerText+"Neither bad or birlliant. Good effort " +username+ ".</h5>"; } if(score>=4 && score <=4){ answerText=answerText+"4/5 aint bad " +username+ "!</h5>"; } if(score>4){ answerText=answerText+"You are a footballing expert " +username+ "!!</h5>"; } document.getElementById("results").innerHTML = answerText; } function changeDivImageFemale() { var imgPath = new String(); imgPath = document.getElementById("quiz_box").style.backgroundImage; if(imgPath == "url(images/boy.jpg)" || imgPath == "") { document.getElementById("quiz_box").style.backgroundImage = "url(images/girl.jpg)"; } } function changeDivImageMale() { var imgPath = new String(); imgPath = document.getElementById("quiz_box").style.backgroundImage; if(imgPath == "url(images/girl.jpg)" || imgPath == "") { document.getElementById("quiz_box").style.backgroundImage = "url(images/boy.jpg)"; } } function changeDivImage(url) { document.getElementById("third_col").style.backgroundImage = "url('images/" + url + "')"; } //radio button links function go(loc) { window.location.href = loc; } ///// function quiz_alert() { alert ("Thank you. You're questions will be change accordingly."); } HTML Code: <SCRIPT LANGUAGE="JavaScript" type="text/javascript" src="javascript/javascript.js"></script> <link rel="stylesheet" href="style.css" type="text/css" /> </head> <body> <div id="full_page_wrap"> <div id="main_wrap"> <div id="header"> </div> <div id="first_col"> <ul id="menu"> <li><a href="index.htm">Home</a></li> <li><a href="quiz.htm">Take the quiz</a></li> <li><a href="links.htm">Links</a></li> </ul> </div> <div id="second_col"> <h1><div id="welcome_message"></div></h1> <hr/> <form id="my_form" action="#" name="my_form" "> <p>Please enter your name:</p> <input type="text" name="visitor_name" id="visitor_name" /> <input type="submit" value="Submit" onsubmit="return" /> </form> <p>Your favourite football team: <form action=""> <select onchange="changeDivImage(this.value)"> <option>Choose your favourite team</option> <option value="arsenal.png">Arsenal</option> <option value="aston_villa.png">Aston Villa</option> <option value="birmingham_city.png">Birmingham City</option> <option value="blackburn_rovers.png">Blackburn Rovers</option> <option value="bolton_wanderers.png">Bolton Wanderers</option> <option value="burnley.png">Burnley</option> <option value="chelsea.png">Chelsea</option> <option value="everton.png">Everton</option> <option value="fulham.png">Fulham</option> <option value="hull.png">Hull City</option> <option value="liverpool.png">Liverpool</option> <option value="manchester_city.png">Manchester City</option> <option value="manchester_united.png">Manchester United</option> <option value="portsmouth.png">Portsmouth</option> <option value="stoke_city.png">Stoke City</option> <option value="sunderland.png">Sunderland</option> <option value="tottenham_hotspur.png">Tottenham Hotspur</option> <option value="west_ham.png">West Ham</option> <option value="wigan_athletic.png">Wigan Athletic</option> <option value="wolverhampton_wanderers.png">Wolverhampton Wanderers</option> </select> </form> <p>Please chhose your gender: </p> <input type="radio" name="gender" value="Male"/> Male <input type="radio" name="gender" value="Female" onClick="go('female.htm'); quiz_alert()"> Female <center> </div> <div id="third_col"> <div id="results"></div> </div> </div> </div> </body> </html> I want an input field to input a password, however I dont want it to look like a password field. I would like to dispay a default text of the date in plain text and when the user enters text into the field it is displayed as an obscured password. I use Code: <input class="exiter" <?php echo ("value=\"".date("d/m/Y")."\""); ?> type="text" name="Exiter" maxlength="10" size="10" > To display the date in plain text. But obviously when I enter data it is displayed in plain text. If I change the type to password the date is displayed as obscured text. Is this possible? I have the html code: <div style="width: 100%; height:100%; background-color: orange;"><input type="text" style="border-style: solid;border-width: 1px;border-color:black;"/></div> In IE7 the input will start one pixel below the div, in Firefox it displays well. How can I get rid of the 1px in IE7 ? <html> <img src="http://salesmarketinginfo.googlepages.com/eye-world.jpg" width="695" height="120"> <hr> <bgcolour="white"> <br></br> <body> <form action="MAILTO:adamz14@hotmail.com" id="thisform" method="post" enctype="text/plain"> Name:<br> <input type="text" name="name"> <br> Mail:<br> <input type="text" name="mail"> <br> Comment:<br> <input type="text" name="comment"> <br><br> <input type="submit" value="Send"> <input type="reset" value="Reset"> </form> </body> </html> How do I change height of "comment" input ? Hey all iv been away for some time now but now im back Im in the process of rebuilding a site for the company i currently work for, but i need some advice maybe some design tips, i have a few things in mind but i dont want to go OTT with it, im aiming to keep it fresh, simple, so nice functionality so its more up to date and modern if you browse to http://www.businessphonesdirect.co.uk/home/index and you will see what is currently in place, i have been told this is a basic site well temp and i was my idea to create a new one "which they dont know about " so its more of a surpise any input would be highly appreciated 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 |