Jeff van Aswegen
jeffmess at gmail.com
Thu Nov 8 09:41:37 EST 2007
Hi Guys I sent an e-mail yesterday regarding submitting a form without reloading the page. I've been looking into xmlhttprequest and I have written a small app which works fine with PHP but I am struggling to get it working with mod_python. Here is a simplified version of what I have so far. req.write(""" <form name="form"> <input type="text" name="news_title" id="news_title"> <input type="text" name="news_content" id="news_content"> <a onclick="javascript:ajaxform('index.py/somefunction', 'form', 'content');" style="cursor: pointer;">Submit</a> </form> <div id="content"> </div> """) I'm not going to place my javascript here unless you need it for some reason. Basically it creates an xmlhttp instance and sends it with the following. http_request.open('GET', url, true); My PHP code which does what I want for the time being is. <?php echo '<pre>'; print_r($_REQUEST); echo '</pre>'; ?> All I want is to basically take the PHP code and get it working in mod_python. I can then take the data and process it in the background while the user can redo the form. So I also want to avoid mod_python.util.redirect() as I don't want the page to reload. The problem is I cannot find the equivalent function of $_REQUEST under mod_python - if there even is one. I would appreciate any help or if someone can possibly point e in the right direction.
|