i feel like im running in circles here, i get it to work one way then i doesnt in another. oh well i got the javascript to work before but now i want to do this with CGI. so i write in topbox, prss submit and the text is then transferred into the bottom box.
ok so how do i do so POST gets called when i press submit? method=post somewhere? in contect or in the submitbutton-tag? i dont get either to work...(i left POST out entirely it out in the html-code below) <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/ TR/html4/strict.dtd"> <html> <head> <meta http-equiv="Content-Type" content="text/html;charset=utf-8" > <title>robber's language</title> <style type="text/css"> <!-- body { margin: 0px; padding: 0px; } #header { background: #FDD017; width: 100%; height: 10%; font-size: xx-large; text-align: center; } #content { background: white; float: right; width: 100%; height: 90%; text-align: center; } a:link {color: black; } a:visited {color: white; } a:hover {color: black; } a:active {color: black; } --> </style> </head> <body> <div id="header"> <b>Robber's language encrypter/decrypter</b> </div> <div id="content"> <div><textarea name="source" cols="60" rows="10"></textarea></div> <div><input type="submit" value="translate"></div> <div><textarea name="target" cols="60" rows="10"></textarea></div> </form> </div> </body> </html> import web import rob render = web.template.render('templates/') urls = ( '/', 'main', ) class main: def GET(self): print render.main() print "get says hey" def POST(self): print "post says hey" i = web.input() phrase = i.source print phrase web.webapi.internalerror = web.debugerror if __name__ == "__main__": web.run(urls, globals()) --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "web.py" group. To post to this group, send email to [email protected] To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/webpy?hl=en -~----------~----~----~----~------~----~------~--~---
