Jump to content

Search the Community

Showing results for tags 'input'.

  • Search By Tags

    Type tags separated by commas.
  • Search By Author

Content Type


  • W3Schools
    • General
    • Suggestions
    • Critiques
  • HTML Forums
    • CSS
  • Browser Scripting
    • JavaScript
    • VBScript
  • Server Scripting
    • Web Servers
    • Version Control
    • SQL
    • ASP
    • PHP
    • .NET
    • ColdFusion
    • Java/JSP/J2EE
    • CGI
  • XML Forums
    • XML
    • Schema
    • Web Services
  • Multimedia
    • Multimedia
    • FLASH

Find results in...

Find results that contain...

Date Created

  • Start


Last Updated

  • Start


Filter by number of...


  • Start





Website URL








  1. I'd like to disable certain input boxes, but without changing the HTML code manually. For example:I'd like to disable the input boxes with the following id's:id="first_field"id="fourth_field"id="sixth_field" <div> <form action=""> <fieldset> <input type="text" id="first_field"/> <input type="text" id="second_field"/> <input type="text" id="third_field"/> <input type="text" id="fourth_field"/> <input type="text" id="fifth_field"/> <input type="text" id="sixth_field"/> </fieldset> </form> </div> Anyone know a Javascript that can do this?
  2. I'd like to hide the corresponding button when an input value is empty or has a value="n/a". In the following example, the input box "first_field" is corresponding with the button "first_button", and the input box "second_field" with the button "second_button", and so on... In this case the second and fifth button will be hidden: <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"><html xmlns="http://www.w3.org/1999/xhtml"><head><meta http-equiv="Content-Type" content="text/html; charset=utf-8" /><title>Hide Button When Input Value Is Empty</title></head><body> <div> <form action=""> <fieldset> <input type="text" id="first_field" value="1"/> <input type="text" id="second_field" value=""/> <input type="text" id="third_field" value="3"/> <input type="text" id="fourth_field" value="4"/> <input type="text" id="fifth_field" value="n/a"/> <input type="text" id="sixth_field" value="5"/> </fieldset> </form> </div> <div> <form action=""> <fieldset> <div id="first_button"><input type="button" value="First Button"/></div> <div id="second_button"><input type="button" value="Second Button"/></div> <div id="third_button"><input type="button" value="Third Button"/></div> <div id="fourth_button"><input type="button" value="Fourth Button"/></div> <div id="fifth_button"><input type="button" value="Fifth Button"/></div> <div id="sixth_button"><input type="button" value="Sixth Button"/></div> </fieldset> </form> </div></body></html> Anyone know a Javascript that can do this?
  3. I have a form that looks like this. I currently have it set up using two div tags. The left side is one and the right side is another. If I have my cursor in the Email Address input and press TAB, it goes to Password input. I want to set it up where it looks exactly the same, but when I press TAB, it goes to Confirm Email Address input. Basically, I am wondering how I could align my page without using separate tags, so when I press TAB, it goes to the next one.
  4. <form name="form" action="enter.php" method="post"> First Name: <input type="text" name="first" /><br /> Last Name: <input type="text" name="last" /><br /> <input type="checkbox" name="c1" value="1" onclick="showSubmit()" /> <input type="checkbox" name="c1" value="1" onclick="showSubmit()" /> <input type="checkbox" name="c3" value="1" onclick="showSubmit()" /> <!-- SUBMIT BUTTON HERE --> </form> If I only check the 1st and the 3rd checkbox and press the submit button, but in my enter.php, I made it check print out each of the inputs like so: <?php echo $_POST["first"];echo $_POST["last"];echo $_POST["c1"]; echo $_POST["c2"]; echo $_POST["c3"];?> I will get a warning/error claiming that the c2 is undefined. Is there a built in function that checks if something is undefined ? That way I can use a if and else statement: if is it undefined, it will print something, and if it is checked (defined), make it print something else.
  5. I'm working on a site and i want to use icons to select travel modes,i have an working function but it only works with a selection input.Is there a way to modify it to be used with buttons? Thanks in advance! Function: function calcRoute() { var selectedMode = document.getElementById("mode").value; var request = { origin: thuis, destination: kabk, // Note that Javascript allows us to access the constant // using square brackets and a string value as its // "property." travelMode: google.maps.TravelMode[selectedMode] }; directionsService.route(request, function(response, status) { if (status == google.maps.DirectionsStatus.OK) { directionsDisplay.setDirections(response); } }); HTML - Select input <select id="mode" onchange="calcRoute();"> <option value="DRIVING">Driving</option> <option value="WALKING">Walking</option></select> HTML - Button input (?) <form id="mode"> <input type="button" onchange="calcRoute();" value="DRIVING"> <input type="button" onchange="calcRoute();" value="WALKING"></form>
  6. Hello everyone, well I'll give you a quick run down about myself so you can best help me or straight up ignore me :-)I have learnt most of the stuff I know from w3schools and just from viewing the source of websites and putting 2 and 2 together. I'm not going to pretend I am smart or a quick learner, I learn best in reverse. I understand codes etc.. more by reading the full code and seeing what each part does rather then putting it all together myself, I'm sure people like me are frustrating for people who are smart, but guess what I frustrate myself.Anyway what I am trying to do is basically make a tool to help people index their websites with "whois" style websites. I have found some php codes for this but I am unable to use php on the server I use, so I can only do it with javascript.What I need to do is have users enter their website and it is input onto the end of serveral urls and opens the pages. Example: I type mysite.com and press submit And several pages open http://tools.whois.com.au/whois/mysite.com http://www.checkpagestats.com/www/mysite.com http://www.alexa.com/siteinfo/mysite.com etc... etc.. etc... I did have the code below but it just opens the website you input :-( SO please HELP ME, can I edit the code below to do what I want or am I way off track? <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd"><html><head><meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"><title>Link Insertion</title></head><body><form style="margin-top: 10px;"><fieldset><label>Url </label><input type="text" name="url" id="url" /><br/><label>Caption </label><input type="text" name="cap" id="cap" /></fieldset><input type="button" name="insert" value="INSERT LINK" id="insert" /></form><script type="text/javascript">document.getElementById("insert").onclick = function(){if(document.getElementById('url').value !== ""){var a = document.createElement('a');var br = document.createElement('br');a.href = document.getElementById('url').value;var c = document.getElementById('cap').value || new Date().getTime();a.innerHTML = c;var container = document.getElementById('linkcontainer');container.appendChild(a);container.appendChild(br);}}</script></body></html>
  7. I am trying to change the background color of an input text field. I am attempting to use a function to do this. The function is called by clicking on certain buttons. Is it possible to do what I want, and how can it be done ? I am using Windows 7, Firefox 8 and IE 9. Thank you. Code Author Stephanie Griswold. <html><head><script type="text/javascript">function setOFF() { document.mainForm.Output.value="OFF"; document.mainForm.Output.style="background-color: #ff0000"; }function setON() { document.mainForm.Output.value="ON"; document.mainForm.Output.style="background-color: #00ff00"; }</script></head><body><form name="mainForm"><table><tr><td align="center">Input</td><td>Output</td></tr><tr><td align="center"> <input type="button" value="OFF" onclick="setOFF()"; /> <input type="button" value="ON" onclick="setON()"; /></td><td> <input type="text" size="10" name="Output" value="Output" /></td></tr><tr><td colspan="2"> Below is how I want the Output field to look when OFF or ON buttons are clicked:</td></tr><tr><td colspan="2" align="center"> <input type="text" size="10" name="WhatIWantOff" value="OFF" style="background-color: #ff0000"; /> <input type="text" size="10" name="WhatIWantOn" value="ON" style="background-color: #00ff00"; /></td></tr></table></form></body></html>
  8. hello everyone, it is long time ago that i visited this forum. and as i see there is better user interface. i really enjoy it. now to my issue: ap-town.php for example select options are postcodes: NW2-Cricklewood - value="40"N1-Hixton - value="44"NW2-Kilburn - value="39" <form action="ap-town-process.php" method="post"><select name="town"><option value="" selected="selected">Destination Town</option> <?php while($town_rows=mysql_fetch_array($town_result)) { ?> <option value="<?php echo $town_rows['lhr_town_value']; ?>"><?php echo $town_rows['lhr_town_to'];?></option> <?php } ?> </select><input type="submit" /></form> ap-town-process.php <?php $ap_town_towns=$_POST['town']; $query_towns=mysql_query("SELECT * FROM lhr_town WHERE lhr_town_value='$ap_town_towns'") or die(mysql_error());$fetch_towns=mysql_fetch_array($query_towns); ?> <form action="ap-town-execute.php" method="post"> <input type="text" name="ap_town_dropoff" value="<?php echo $fetch_towns['lhr_town_to'];?>" readonly="readonly" /> <input type="submit" /></form> the drop in ap-town.php takes the values from the database and would be processed at ap-town-process.php. if i select NW2-Cricklewood in the ap-town-process.php it would give me N1-Hixton altough the values are completly different. in some cases the values are the same, but the but the names area names different. please help me fix this issue.
  9. The idea:The idea is to automatically fill the fields with "user@mail.com" and "password" if they're left blank. The problem:Well, the Javascript check is working and doing what it is supposed to. However, if the user adds a value, and then erases that value leaving the input empty, the script doesn't detects the field as empty... although the value returned is indeed empty like "". The code: function loginFormToggleFillers(element){ var loginF = document.loginForm.login; var user = loginF.value; var passwordF = document.loginForm.password; var password = passwordF.value; if(element){ el = element.attributes["name"].value; if( el == "login" ){ if ( user == "" || user.length == 0 ){ loginF.setAttribute("value", "user@mail.com"); } if ( user == "user@mail.com" ){ loginF.setAttribute("value", ""); } } else if ( el == "password" ){ if ( password == "" || password.length == 0 ){ passwordF.setAttribute("value", "password"); } if ( password == "password" ){ passwordF.setAttribute("value", ""); } } } else { if ( user == "" || user.length == 0){ loginF.setAttribute("value","user@mail.com"); } if ( password == "" || password.length == 0){ passwordF.setAttribute("value","password"); } }}loginFormToggleFillers(null); The HTML call (wrote by hand, so there might be a mistake somewhere... but it's just the idea): <input type="text" name="login" onFocus="loginFormToggleFillers(this)" onBlur="loginFormToggleFillers(this)" /><input type="password" name="password" onFocus="loginFormToggleFillers(this)" onBlur="loginFormToggleFillers(this)"/> Any ideas on this? Thanks in advance!
  10. Hello Everyone! I am making HTML 5 exercices for children with the Google Chrome Browser & HTML 5 Speech Input. Now my problem is that the Speech Input misses a lot for example I said "Nine" and Google Chrome filled in "Ni**er" & I said "Cat" Chrome filled in "Pu**y". So I did research and I know it is possible with the Opera variant to define a set of limited words called "Grammar". Now we got to my question: "Is it possible to define a Grammar (set of words) with the HTML 5 Speech Input". A bonus question: "Do you know an example website with some fancy things that u can do with the Speech Input" Thanks to anyone who can help! Kind regards
  • Create New...