HTML - What Is The Difference Between <input Type="button" /> And <input Type="button" >
i have seen alot of place on web that sometimes programmers are using :-
<input type="button" / > and sometimes <input type="button" > Is there any difference between the two? What is correct way of using <input> tag, is it with end slash '/' or not ? Similar TutorialsHi, I have got an input form to upload files; the form also accepts some other user input. The upload works fine, but I need to display some filenames by default, but this does not work. I tried using: <input type="file" name="images[]" value="<?php echo $default_filename; ?>"... This did not work, so I tried: <input type="file" name="images[]" value="Testfile.jpg"..., but this does not work too. All this is in a <form action="<?php echo $_PHP_SELF; ?>" method="post" enctype="multipart/form-data">. It seems to me that in an input field of type "file", default values are not accepted, though they should be according to the documentation. Any help will be greatly appreciated as I need this feature. Thanks On my page, I have a form: HTML Code: <div id="upfile"> <input type="file" name="uploadform" size="30" id="fileupload2"> </div> Now, I'm wondering, is there any way that I can set a default value for this? Ex "C:\My Documents\file.txt". I tried value=, but I guess it doesn't work for the "file" type. I'd change it, but I need it to be "file".. Any help? Edit: Just realized that spelling mistake in the title.. I have a project written in ASP.NET under Visual Studio 2005 with C#. I am also using Infragistics objects for .NET Advantage 2007. In my page to attach resources to a record I have written a browser and am displaying previously chosen resources here. But when I click the upload button the page opens a new window (which is not a dialog window, but a normal one) which is exactly the same as my dialog window. How can this possibly happen? Can anyone help me? Hey, I'm trying to write some code for expanding and concealing text You can see this in action at youtube when you click the (more) button to expand text. Suppose I had a heading: MyHeading and a body of text: MyTextHere How do I make it so that when you click MyHeading it makes MyTextHere (initially not visible) appear, and when you click MyHeading again, it makes MyTextHere disappear? Thanks Alot. Hey guys, I've been working on this website some more, & many of you have been a great help to me in the past. I've come with another question.. http://www.cedarcreekyouth.org/ This is the page I ran through the W3C Validation thing.. I've got two more errors and three more warnings. I do not know how to fix them.. I've tried a few things, but my knowledge has failed me. Could someone show me how to fix this, with an explanation? Please and Thank you. Cody Can someone help here. I have tried other groups and no help. I have a web page with image buttons. This is supposed to take me to difrent web pages depending on which button is clicked. This works in Firefox and Opera but not in IE8 http://www.des-otoole.co.uk/cms/admin/pages.php Desmond. Hi I'm having problems with this code the 1st section is what W3 gave me, unsure which one to use the bottom section is what I have in my website, thanks for any help Line 704, Column 8: document type does not allow element "STRONG" here; missing one of "P", "H1", "H2", "H3", "H4", "H5", "H6", "PRE", "DIV", "CENTER", "NOSCRIPT", "NOFRAMES", "BLOCKQUOTE", "FORM", "ADDRESS" start-tag <strong><span class="c22"><strong><span class="c22"><strong><span class="c22"><s ✉ The mentioned element is not allowed to appear in the context in which you've placed it; the other mentioned elements are the only ones that are both allowed there and can contain the element mentioned. This might mean that you need a containing element, or possibly that you've forgotten to close a previous element. One possible cause for this message is that you have attempted to put a block-level element (such as "<p>" or "<table>") inside an inline element (such as "<a>", "<span>", or "<font>"). -------------------------------------------------------------------------------------------------------- <h3 class="c18"><strong><a href="Photo%20Gallery2.htm"><span class="c22"><img src="aSinkingphoto2.jpg" alt="Photo Gallery of ships, mammels, icebergs and fish" width="190" height="103" border="0" usemap="Index.htm#Map2Map" class="style1"></span></a> <span class="c22"><map name="Map2Map" id="Map22"> <area shape="rect" coords="-9,-5,191,106" href="Photo%20Gallery2.htm" target="_self" alt="Photo Gallery of Ships"> <strong><span class="c22"><strong><span class="c22"><strong><span class="c22"><strong><span class="c22"><strong><span class="c22"><strong><span class="c22"><span class="style2 c23"> href="Photo%20Gallery2.htm" target="_self"><br></span> <span class="style1">href="Photo%20Gallery2.htm" target="_self"><span class="c23"><strong>Click image for Photo Gallery</strong></span></span></span></strong></span></strong></span></strong></span></strong></span></strong></span></strong ></map></span></strong></h3> Hello Everyone, Please help me. I am going to validate my html page using w3c html validator. I got the errors like this document type does not allow element "STYLE" here. <style type="text/css"> Please anyone help me how to solve this error. Thanks in advance. Prabhu hello, can you please give me a sample code showing the difference between ismap and usemap. I need to give a seminar on it !!!!! hi i keep getting spam from my site because their is no security on my 'comments' box. where can i find a code for putting one of those scrambled images that u have to type in that computers arent meant to be able to recognise? i dont know what to type in in google? thanks in advance http://www.colletts.co.uk/winter_dolomites.htm I have the above page that redirects users to my Winter Website - the HTML below isn't valid W3C does anyone know of a better and valid way to get this done? Cheers, Mas HTML Code: <META HTTP-EQUIV="Refresh" CONTENT="2.5;URL=http://www.colletts.co.uk/winter/winter_dolomites.html" /> A customer gave me a Word doc that they want turned into a printer friendly web page. I understand that there are tons of ways to do this but I really want the answer to the subject. What i'm referring to is a form that someone can print from the browser and "fill in the blanks" on the page where there are "underscores". My question is how to code those underscores. I tried manipulating the <hr> tag but it's putting way too much space in between each <hr>. I've already coded a "fill in the blank" line using <u> nbsp;</u> but that looks very messy. What do you guys/gals think? I was hoping someone could clue me in as to whether or not this would be possible. I'm thinking it isn't but I need to make sure. I'd like to provide a file for people to download on my website, but when they click on the link and the download window appears I don't want them to have the option of opening it. Is it possible to only give them the option to save the file? Sounds incredibly unlikely but I gotta know. this is a noob question how can i align input fields? like Code: <html> <body> <form> username:<input type="text" name="user" /> password:<input type="password" name="pass" /> </form> </body> </html> take this in this by default the text and password fields will come on left hand side but i want it in right . so how can i do that ? How can I restrict form submission to only the Submit button? I find the forms can be submitted also by the user pressing the "enter" or the "return" key (Users typically use IE or Firefox) By a mouseover the "Submit" button, a final check of data integrity is done as follows.... <INPUT type="submit" value="Submit Form" onmouseover="validate(personal_SS.value,personal_SS.id,personal_lastname.value,personal_lastname.id, personal_firstname.value,personal_firstname.id,personal_Birthdate.value,personal_Birthdate.id)"> <INPUT type="reset" value="Clear form"> Data is 128 bit SSL encrypted function validate(strngSS,x,strngLN,y,strngFN,z,strngBD,w) { if (strngSS== "") {alert("You didn't enter a Social Security Number."); document.ReturnPatientEntry.x.focus(); return; } else { if ((strngSS.length < 9) || (strngSS.length > 9)) {alert("The Social Security Number is the wrong length. Just use numbers, no dashes... like 123456789 not " + strngSS); document.ReturnPatientEntry.x.focus(); return; } else { var illegalChars = /\W\#/; if (illegalChars.test(strngSS)) {alert( "The Social Security Number contains illegal characters. Just use numbers, no dashes or # signs."); document.ReturnPatientEntry.x.focus(); return; } } } validateLN(strngLN,y) validateFN(strngFN,z) validateBD(strngBD,w) } function validateLN(strng,x) { if (strng== "") {alert("You didn't enter a Last Name."); document.ReturnPatientEntry.x.focus(); return; } else { if ((strng.length < 3) || (strng.length > 15)) {alert("The Last Name is the wrong length. Just use letters, no dashes... " + strng); document.ReturnPatientEntry.x.focus(); return; } else { var illegalChars = /\W\#/; if (illegalChars.test(strng)) {alert( "The Last Name contains illegal characters. Just use letters, no dashes or spaces."); document.ReturnPatientEntry.x.focus(); return; } } } } function validateFN(strng,x) { if (strng== "") {alert("You didn't enter a First Name."); document.ReturnPatientEntry.x.focus(); return; } else { if ((strng.length < 2) || (strng.length > 12)) {alert("The First Name is the wrong length. Just use letters, no dashes... " + strng); document.ReturnPatientEntry.x.focus(); return; } else { var illegalChars = /\W\#/; if (illegalChars.test(strng)) {alert( "The First Name contains illegal characters. Just use letters, no dashes or spaces."); document.ReturnPatientEntry.x.focus(); return; } } } } function validateBD(strng,x) { if (strng=="") {alert("Please enter a valid Birthdate"); document.ReturnPatientEntry.x.focus(); return; } else { if ((strng.length<8) || (strng.length>8)) {alert("Please enter your Birthdate in the form mm/dd/yy, not " + strng); document.ReturnPatientEntry.x.focus(); return; } else { var illegalChars=/[\-\.\m\,\ ]/; if (illegalChars.test(strng)) {alert("The Birtdate contains illegal characters, use the format mm/dd/yy, not " + strng); document.ReturnPatientEntry.x.focus(); return; } } } } I know the coding is primitive, but it works. If the "Clear form" button is pressed, multiple consecutive error messages are tripped as the form is cleared. Can I suppress this as well? Thanks, Douglas McKibbin augustasurgery.org Hi, I've got three buttons on a page and basically all I'm trying to do is put a BACK button as one of the three. But I'm having difficulties getting it to work. Code: <form name="reservationinfo" action="reservationcollected.php" method="post"> <input type="hidden" name="reservationID" value="<? echo $reservationID; ?>"> <center> <table width="400" border="0" cellspacing="5"> <tr> <td><input type="submit" value= "Reservation Collected" class="button" name="submit"></td> <td><input type="submit" value='Cancel Reservation' onclick="reservationinfo.action='admincancelreservation.php'; return true;"></td> <td><input type="submit" value='Back' onclick="reservationinfo.action='history.go(-1)'; return true;"></td> </tr> </table> </center> </form> The solutions Ive been trying either take me to reservationcollected.php OR says history.go(-1) CANNOT BE DISPLAYED. Any ideas? Cheers hi, i am working on <div> i have to hide some part of the table. I am not able to hide that table part can anybady tell me where is the error. Code: <html> <head> <script type="text/javascript"> function callme(){ document.getElementById("hid").style.visibility="visible"; } function hideme(){ document.getElementById("hid").style.visibility="hidden"; } </script> </head> <body> <form name="myform"> <table width="100%" border="4" cellpadding="2" cellspacing="2"> <tr> <td class="tableheader" colspan="9">TS </td> </tr> <div style="visibility:hidden" id="hid"> <tr> <td width="17%" class="labeltext">Tran Code</td> <td width="1%" class="blanktext">:</td> <td colspan="4" class="blanktext">Name</td> </tr> <tr> <td width="17%" class="labeltext">Product Type</td> <td width="1%" class="blanktext">:</td> <td colspan="4" class="blanktext"> </td> </tr> </div> <tr> <td> </td> </tr> </table> <input type="button" onclick="callme()" value="show"> <input type="button" onclick="hideme()" value="hide"> </form> </body> </html> thx in Adv, Hanm. Hello, I want to load a page in a iframe, and when i do this, i want that page to be displayed not at the begining of that page, i want that page to be displayed at a "x" and "y" position specificated by me. How can i do that? Thank you. Hello, New to the forum. I was wondering how I could make a "vote" type feature on my site... for example: Which do you prefer: Apples or Bananas? (radio button) Apples (radio button) Bananas submit vote Thank you |