Greetings, fellow monks
To help the interns at my town hospital set up their shift calendars I wrote an openoffice base macro (in OObasic, bleh) after some time I rewrote it in java to make it portable, then when I thought about the hassle of having untrained user open a terminal and type "java -jar mything --xls input.xls" I decided to set it up as a web application.
After falling in love with perl I decided to get rid of that crap and rewrite it in perl using Catalyst.
After some fiddling around I managed to setup a session system using cookies so the server can keep track of data added by users during their sessions, problem is I am now coding the ability to delete any data they have entered and I hit quite a roadblock : how do I do that?
Data is submitted to the server in the url using a GET request and the following scheme :
[% FOREACH key IN services.keys -%]
<li onclick="select(this)">service : [%key%] jours de re
interieur : [%services.$key.interieur%]</li>
[% END -%]
Because I save everything in a hash of hashs inside my session.
here is the form used to enter data that is sent to the server and displayed on the webpage :
<label for="ns">nom du service </label>
<input type="text" name="nom_service" id="ns" value="s
<label for="nbjdr">nombre de jours de repos</label>
<input type="number" id="nbjdr" name="nb_jours_repos"
<label for="int">service d'intérieur?</label>
<input type="checkbox" id="int" name="interieur" />
<input type="submit" value="ajouter"/>
<input type="button" class="remove" onclick="remove()"
I can set any of those list item class to selected but what should happen when I press the delete button, I need to delete those entries on the server as well, not just in the client browser. I think some kind of request should be in order but I haven't the foggiest about how it should be handled, maybe a special case of submit with a hidden delete boolean set to true..? If anyone cares to give me a hint about the best way to do it it would be most welcome.
Are you posting in the right place? Check out Where do I post X? to know for sure.
Posts may use any of the Perl Monks Approved HTML tags. Currently these include the following:
<code> <a> <b> <big>
<blockquote> <br /> <dd>
<dl> <dt> <em> <font>
<h1> <h2> <h3> <h4>
<h5> <h6> <hr /> <i>
<li> <nbsp> <ol> <p>
<small> <strike> <strong>
<sub> <sup> <table>
<td> <th> <tr> <tt>
Snippets of code should be wrapped in
<code> tags not
<pre> tags. In fact, <pre>
tags should generally be avoided. If they must
be used, extreme care should be
taken to ensure that their contents do not
have long lines (<70 chars), in order to prevent
horizontal scrolling (and possible janitor
Want more info? How to link
or How to display code and escape characters
are good places to start.