2019-08-12 14:08:51 4299瀏覽
今天千鋒扣丁學(xué)堂Python培訓(xùn)老師給大家分享一篇關(guān)于Flask框架學(xué)習(xí)筆記之表單基礎(chǔ)介紹與表單提交方式詳解,結(jié)合實(shí)例形式分析了flask框架中表單的基本功能、定義、用法及表單提交的get、post方式使用技巧,下面我們一起來看一下吧。
<!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"> <title>Title</title> </head> <body> <form> <input type="text" placeholder="Text" name="text" /># text <input type="password" placeholder="password" name="password" /># password <textarea placeholder="Textarea" name="textarea" style="resize:none"></textarea># 文本區(qū)域 <input type="file" name="file" /># 文件上傳 <input type="radio" name="Option" value="Option1" /> Option1# 單選框 <input type="radio" name="Option" value="Option2" /> Option2 <input type="checkbox" name="Option" value="Option1" /> Option1# 多選框 <input type="checkbox" name="Option" value="Option2" /> Option2 <input type="submit" value="Submit" /># submit按鈕 <input type="reset" value="Reset" /># 重置按鈕 <input type="button" value="button" /># 普通按鈕 </form> </body> </html>
function getValue() { var text=document.form1.text1.value; alert(text) }
<!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"> <title>Title</title> <script type="text/javascript" src="../static/j.js"></script># 這里插入js腳本 </head> <body> <form name="form1"># 添加表單名字 <input type="text" placeholder="Text" name="text1" /># 修改text表單名 <input type="password" placeholder="password" name="password" /> <textarea placeholder="Textarea" name="textarea" style="resize:none"></textarea> <input type="file" name="file" /> <input type="radio" name="Option" value="Option1" /> Option1 <input type="radio" name="Option" value="Option2" /> Option2 <input type="checkbox" name="Option" value="Option1" /> Option1 <input type="checkbox" name="Option" value="Option2" /> Option2 <input type="submit" value="Submit" /> <input type="reset" value="Reset" /> <input type="button" value="button" οnclick="getValue()" /># 點(diǎn)擊就調(diào)用getValue()函數(shù) </form> </body> </html>
【關(guān)注微信公眾號獲取更多學(xué)習(xí)資料】 【掃碼進(jìn)入Python全棧開發(fā)免費(fèi)公開課】
查看更多關(guān)于"Python開發(fā)資訊"的相關(guān)文章>