00:55:33 <CalmNelly> ACTION looks around
02:56:46 <SgtCucumber> hello
02:56:55 <SgtCucumber> i have a question
02:58:48 <SgtCucumber> how does happstack and blazehtml work together, because I've only seen blazehtml on it's own and happstack on it's own
16:03:34 <CalmNelly> hello
16:03:37 <CalmNelly> ACTION looks around
16:07:08 <CalmNelly> In the crash course Part RqData section File Uploads, I downloaded and tried to compile RqDataUpload.hs ,but it gave me this error:
16:08:16 <CalmNelly> http://pastebin.com/5GUL2Mz8
16:08:32 <CalmNelly> Does anyone know a quick fix?
16:08:53 <CalmNelly> I'll be back in an hour, going to eat lunch
17:08:01 <CalmNelly> hello
17:14:47 <stepcut> hello
17:15:03 <CalmNelly> !
17:15:16 <CalmNelly> did you see my pastepin
17:15:17 <stepcut> CalmNelly: I fixed the tutorial -- enctype was missing from blaze when I wrote the tutorial, so I sent a patch. But then I forgot to update the tutorial after he applied the patch ;)
17:15:31 <CalmNelly> ok
17:15:57 <stepcut> eventually the tutorial is supposed to have a target which checks that all the examples compile so that this type of thing will be caught automatically
17:16:08 <CalmNelly> ahhhh
17:16:09 <stepcut> but that has not been implemented yet.. though it shouldn't be too hard
17:16:17 <CalmNelly> cool
17:16:33 <stepcut> alas, there are many things which are 'not to hard' which could be done :)
17:16:48 <CalmNelly> sounds interesting
17:18:18 <CalmNelly> so i just gotta d/l again and it should be fine?
17:19:34 <CalmNelly> n/m i answered my own question just now
17:19:38 <CalmNelly> thanks
17:20:12 <stepcut> yeah
17:20:15 <CalmNelly> hehe
17:20:20 <stepcut> or you could just delete the lines yourself
17:20:39 <CalmNelly> oh :x
19:36:16 <CalmNelly> maybe someone can enlighten me on how this exactly works
19:37:22 <CalmNelly> we have our GET and POST method, and I think I'm supposed to use POST to send a string that I collect from a form, but to what server??
19:38:17 <CalmNelly> since i'm trying to build on my local machine
20:00:49 <stepcut> if the action attribute of the form, if you do not specify a server, it will automatically send it back to the server that supplied the form
20:00:55 <stepcut> you should still include a path though
20:40:01 <stepcut> CalmNelly: did you see my response ?
20:40:20 <CalmNelly> nope
20:40:38 <stepcut> if the action attribute of the form, if you do not specify a server, it will automatically send it back to the server that supplied the form
20:40:43 <stepcut> you should still include a path though
20:42:58 <CalmNelly> I'm using the RqDataUpload example, so right now dir is set to /path and then the name of file
20:44:30 <stepcut> dir ?
20:44:56 <CalmNelly> but I'm trying to change it, so that it takes my value from the text field and feeds it to a function. I'm thinking this function will be applied to the text field data
20:44:59 <CalmNelly> directory
20:46:37 <stepcut> so, in uploadForm you would instead have a form that has a text input and a submit button instead of a file input and a submit button
20:46:47 <CalmNelly> correct
20:46:56 <stepcut> and in the 'post' function, you would change lookFile to 'look' or something
20:47:35 <stepcut> if you look at this section, http://www.happstack.com/docs/crashcourse/RqData.html#rqdataparsing
20:47:53 <stepcut> you will see how to get the field and convert it to another type
20:48:12 <stepcut> in those examples it gets the parameter from the url, but getting it from the form data is exactly the same
20:52:03 <CalmNelly> this example takes the value from the URL, which confuses me, cause i don't want to do that. I just want to stay on the same page.  For now
20:52:50 <CalmNelly> let me try to figure this out
20:53:15 <stepcut> there are three ways that a user can submit data to the website: via the query_string portion of the URL, via a cookie, or via the request body
20:53:29 <stepcut> the look functions will look at the QUERY_STRING and the request body by default
20:54:08 <stepcut> when you are submitting  a form via a POST, the form values get sent as the request body
20:55:31 <stepcut> so, there are two pieces here (1) you create a form which submits values to the website (2) you have code which extracts the form values and does something with them
20:56:33 <stepcut> processing a form requires two requests the server. First the client requests the page which has the form on it. When the user submits the form, the client sends the results to the server, and gets back a response page.
20:57:32 <stepcut> what do you mean by 'stay on the same page' ?
20:58:22 <stepcut> you can use, method GET, vs , method POST, to select between just getting the page normally vs processing the posted form data.. if the URL is the same in both instances
20:59:53 <CalmNelly> okay, i was trying to avoid having to generate a response page, but this would probably not be good if something else was to be added
21:00:36 <stepcut> what would you want to show the user if you didn't have a response page ?
21:00:50 <CalmNelly> by same page, for instance, those kilometre to mile calculators do it on the same page
21:01:26 <CalmNelly> I would want to show their answer, which would be either TRUE or FALSE in a separate text box
21:01:40 <stepcut> That is possible to do..
21:02:23 <CalmNelly> I guess i would have the text boxes so that they were disabled and one would give the answer, and another could give some feedback
21:03:08 <stepcut> why text boxes? Why not just <p>some text..</p>
21:03:16 <CalmNelly> t1: "False" t2: "Your statement goes weird at this part"
21:03:18 <CalmNelly> or text
21:03:47 <CalmNelly> wouldn't it have to refresh the page all the time
21:03:59 <CalmNelly> if it weren't in text boxes
21:04:33 <CalmNelly> I don't have much experience with html :\
21:04:50 <stepcut> you have to refresh the page every time the users submits an answer .. that is how forms work
21:05:32 <CalmNelly> ahh, so when they submit, the data is held in a variable and then processed?
21:05:37 <stepcut> if you want to submit data to the server and get back a result with out completely reloading the whole page, then you have to use ajax stuff
21:06:26 <CalmNelly> no ajax stuff then, i just need a functional page at the moment
21:07:11 <stepcut> CalmNelly: I am not really sure what you mean by 'held in a variable and then processed'. When the user submits the form, the web browser encodes all the form values into a special format (mulitpart/form-data), and sends it to the server. On the server, you can then decode the data and look for the fields in the form that you care about
21:07:54 <stepcut> in happstack, getDataFn is what causes the mulitpart/form-data to be decoded, and the look* functions are how you look for specific fields that were in the form
21:08:15 <stepcut> when the browser submits the form data, it expects to get back a response which shows the new page to display
21:08:31 <stepcut> it does not just keep showing the old page.. it expects an entirely new page
21:09:17 <stepcut> so I would recommend you start by having one page that displays the form, and a second page that displays the results of processing the form.
21:10:00 <stepcut> after you get that working, you can do fancier stuff
21:10:09 <stepcut> gotta shower and get to class
21:10:17 <CalmNelly> okay, one
21:10:17 <CalmNelly> sec
21:10:26 <CalmNelly> for the second page, can that be in the same file?
21:10:37 <stepcut> CalmNelly: yes
21:10:42 <CalmNelly> okay cool, thanks
21:10:58 <CalmNelly> showering is overrated
21:11:13 <stepcut> CalmNelly: in the RqUpload example the two pages are uploadForm and post
21:11:33 <CalmNelly> ohhhhhh okay
21:11:45 <CalmNelly> damn...cool
21:12:18 <stepcut> if you don't understand how the upload function turns those functions into two pages, then you might want to start at the beginning of the crash course
21:13:06 <CalmNelly> alright
21:13:53 <stepcut> unfortunately, html, http, etc, is a horrible mess, so we can only do so much to make happstack simple. ultimately you hit the complexity of the underlying technology.
21:16:15 <CalmNelly> :\