May 27, 20197 yr I created/inserted a form in Dreamweaver.In the form,I inserted 2 text field,1 password field and 1 email field.Each one with its respective label in front.Besides that,I also inserted a button to submit the form.so it looks something like this: Username:_______ Name:_________ Email:___________ Password:__________ (Button) But, 1)The button doesn't have a label,I tried to right click to edit the label,but it still doesn't appear,so I tried creating a submit button straight away instead,but it's still the same,so how do I put label or words on a button? 2)The form I create is to the left,any idea how to move it to the center?I've tried defining an id or class for the form and set the align content for that CSS attribute to centre,but it did not move.I haven't tried setting it one by one for every field in the form,but I'll try it soon,but if it succeed,i still don't think it's the best way because I need to do it one by one.
May 27, 20197 yr Best way to do it is not use dreamweaver. but if you must, switch to code view and add the label/styles where necessary.
May 27, 20197 yr Without seeing the code it's difficult to say. Text-align probably won't work. You could try giving the button a width and setting margin: 0 auto;
May 27, 20197 yr 6 hours ago, Cheah Hsun Teik said: 1)The button doesn't have a label,I tried to right click to edit the label,but it still doesn't appear,so I tried creating a submit button straight away instead,but it's still the same,so how do I put label or words on a button? Button are a bit like links, the words between the opening and close become the words. <button>Button Words</button> if using just a submit it''s the value. <input name="Submit" type="submit" value="Button Words"> 6 hours ago, Cheah Hsun Teik said: 2)The form I create is to the left,any idea how to move it to the center?I've tried defining an id or class for the form and set the align content for that CSS attribute to centre,but it did not move.I haven't tried setting it one by one for every field in the form,but I'll try it soon,but if it succeed,i still don't think it's the best way because I need to do it one by one. <form style="margin: 0 auto;"> Form </form> Edited May 27, 20197 yr by BrowserBugs
May 28, 20197 yr Author Ok,thanks,ive already center my form using margin,but not by setting it to 0 auto,as you suggested.And the submit button label is already shown,but 1)the "Submit" button label is only shown during preview in a browser,but in the design view the "Submit" label is not in the button,but outside of the button.Is it supposed to be like this? 2)My form is at the center in browser preview,but in the design view its a bit to the right.Is this ok? 3)When i click Submit after filling all the spaces,it says {"code":"MethodNotAllowedError","message":"POST is not allowed"} Is it because i haven't finish doing what i need yet? Tell me,if you need the code,please...😄😃 Edited May 28, 20197 yr by Cheah Hsun Teik
May 28, 20197 yr It’s not working because you probably haven’t set up the processing script. When the form it submitted you need to tell the browser what to do, normally an ‘action’. This action will be a server side file with all the validation and processing.
May 28, 20197 yr Author HTML code of that specific page: <!doctype html> <html> <head> <meta charset="utf-8"> <title>Register page</title> <link href="style.css" rel="stylesheet" type="text/css"> </head> <body> <header> <h1><span class="EPRB">E</span>-<span class="EPRB">P</span>endaftaran <span class="EPRB">R</span>umah <span class="EPRB">B</span>iru</h1> </header> <h2>Membirukan dunia...Selamat datang ke EPRB...</h2> <form method="post" name="register" id="register"> <p> <label for="Username">Nama Pengguna:</label> <input name="Username" type="text" required="required" form="register"> </p> <p> <label for="Name">Nama:</label> <input name="Name" type="text" required="required" form="register"> </p> <p> <label for="Email">E-mel:</label> <input name="Email" type="email" required="required" form="register"> </p> <p> <label for="Password">Kata laluan:</label> <input name="Password" type="password" required="required" form="register"> </p> <p> <input name="Submit" type="submit" formmethod="POST" value="Submit"> </p> </form> </body> </html> CSS code of all pages: @charset "utf-8"; h1 { font-family: Baskerville, "Palatino Linotype", Palatino, "Century Schoolbook L", "Times New Roman", serif; color: #000000; text-align: center; font-size: 90px; background-color: #3BC2FD; } body { background-color: #D0DAE1; } .EPRB { font-family: Impact, Haettenschweiler, "Franklin Gothic Bold", "Arial Black", sans-serif; font-size: 100px; color: #333FE6; } body h2 { color: #4D74DD; text-align: center; } #register { width: 300px; margin-left: 650px; }
May 28, 20197 yr Author And also the one i created above is for register,i also created one for login,but the error that i got for register does not appear for login,what could be happening? im expecting an error,because as fisicx said i probably haven’t set up the processing script,but it doesnt show this error for the login. Edit:This question is already solve by changing id to class because class can be used to style multiple html at once,but id is only for one,but i forgot.Idk why it can solve,but at least it is solved,but if you all can explain why,its better. And dont forget the first and second question from the question around 6 hours ago before this post. Thanks... Edited May 28, 20197 yr by Cheah Hsun Teik
Create an account or sign in to comment