Krijimi i web formave TIK 12 Prof Blerand
Krijimi i web formave TIK 12 – Prof. Blerand Koshi
Marrja e informatave përmes web formave Përmes web formave mund të mbledhim informacine nga shfrytëzuesit
Web forma Kur ta plotësojmë një web formë, informacionet duhet të dërgohen në web server ◦ Çka bën web serveri me ato informacione? ! HTML elementi është <form> ◦ mbyllja bëhet përmes </form> <form action="#"> <input type="text" name="emailaddress"> <input type="submit" name="submit"> </form>
Forma e thjeshtë <!doctype html><head><title>A Basic Form</title></head> <body> <h 1>A Basic Form</h 1> <hr> <form action="#"> <fieldset> <legend>Form Information</legend> <div> <label for="username">Name: </label> <input id="username" type="text" name="username"> </div> <label for="email">E-mail Address: </label> <input id="email" type="text" name="email"> </div> </fieldset></form></body></html>
Atributet Action - zakonisht lidhet me programin e serverit që do të merret me informacionet e formës Method - paraqet mënyrën e dërgimit të informacioneve deri në server ◦ GET (http: //localhost/form 1. html? username=Steve&email=steve@example. com) ◦ POST
Drop down box <!doctype html> <head><title>A Basic Select</title></head> <body> <h 1>A Basic Select</h 1> <hr> <form action="#"> <fieldset> <legend>Form Information</legend> <div> <label for="state">State: </label> <select id="state" name="state"> <option value="CA">California</option> <option value="WI">Wisconsin</option> </select></div></fieldset> </form> </body> </html>
Check Boxes <!doctype html> <html><head><title>Checkboxes</title></head> <body> <h 1>Checkboxes</h 1> <hr> <form action="#"> <fieldset> <legend>Pizza Information</legend> <div>Toppings: <input type="checkbox" id="sausage" name="toppings" value="sausage"> <label for="sausage">Sausage</label> <input type="checkbox" id="pep" name="toppings" value="pep"> <label for="pep">Pepperoni</label> <input type="checkbox" id="mush" name="toppings" value="mush"> <label for="mush">Mushrooms</label> </div></fieldset></form></body></html>
Radio Buttons <!doctype html> <html><head><title>Radio</title></head> <body> <h 1>Radio</h 1> <hr> <form action="#"> <fieldset> <legend>Pizza Information</legend> <div>Crust: <input type="radio" id="deep" name="crust" value="deep"> <label for="deep">Deep Dish</label> <input type="radio" id="thin" name="crust" value="thin"> <label for="thin">Thin</label> </div> </fieldset> </form></body></html>
Dërgimi dhe fshirja e formës <!doctype html> <html><head><title>A Basic Form</title></head> <body> <h 1>A Basic Form</h 1> <hr> <form action="#"> <fieldset> <legend>Form Information</legend> <div> <label for="username">Name: </label> <input type="text" id="username" name="username"> </div> <label for="email">E-mail Address: </label> <input type="text" id="username" name="email"> </div> <input type="submit" name="submit" value="Send Form"> </div></fieldset></form></body></html>
Forma me CSS <!doctype html> <head> <title>A Basic Form</title> <style type="text/css">. form-field { clear: both; padding: 10 px; width: 350 px; }. form-field label {
Pyetje ?
- Slides: 11