Posts

Showing posts with the label forms

How to change normal behaviour of input submit button for unfilled and required inputs?

How to change normal behaviour of input submit button for unfilled and required inputs? Say you have an html form like the one below. <form> <input type="text" required> <br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br> <input type="submit"> </form> If you click on the submit button without filling the required input, three thing will generally happen. Here is a jsfiddle to see this in action.http://jsfiddle.net/q47kepd0/ I am working on a project where I am making an html file version of a wordpress theme. In the theme the first thing that involves scrolling does happen but the second and the third things don't. So there must be a w...

Get the value from all options (selected and not selected) in select multiple form in PHP

Get the value from all options (selected and not selected) in select multiple form in PHP I need some help with my Select multiple form. When clicking the submit button I want to submit all the values of the options. Selected and not selected options. So if you take the code below as an example. I would like to get all the option values into an array without needing to select them in the Input. <form action="/action_page.php"> <select name="cars" multiple> <option value="volvo">Volvo</option> <option value="saab">Saab</option> <option value="opel">Opel</option> <option value="audi">Audi</option> </select> <input type="submit"> </form> Result: array( [0] => 'volvo', [1] => 'saab', [2] => 'opel', [3] => 'audi' ); This post does everything I want but it is done in ...

Save MS ACCESS attachments with python

Save MS ACCESS attachments with python This seemed pretty simple but it wasn't. The goal was to create an offline database with forms so Users could fill data that will later be put into reports. The catch is that this reports have complex formating and pictures so my idea was to pull data from MS ACCESS (can create tables and forms that manage attachments pretty well) and insert it into word templates using doctpl. My problem is that I can't manage to pull the attached pictures in the ACCESS tables. I've tried using win32com.client like this: import win32com.client daoEngine = win32com.client.Dispatch('DAO.DBEngine.120') db = r"C:UsersPDocumentsdb.accdb" daoDB = daoEngine.OpenDatabase(db) query = "SELECT picture FROM Galery WHERE ID=13" daoRS = daoDB.OpenRecordset(query,2) daoRS.Edit() daoRS.Fields["picture"].SaveToFile("C:UsersPCA037Documents\") daoDB.Close() But it returns error: (-2147352567, 'Exception occurred.',...