views:

29

answers:

1

this is my html :

<div id='automail'>
    <form action = "/admin/mail" method = "get">
        auto mail when user :<br/><br/>
        <div>
            <input type="checkbox" name="automail" value ="signup">signUp</input><br/>
            <input type="checkbox" name="automail" value ="login">login</input><br/>
        </div>
        <div style="text-align:right">
            <input type="submit" value="save"></input>
        </div>

    </form>
</div>

and this is my python handle :

class mail(BaseRequestHandler):
    def get(self):
        all=self.request.get('automail')
        if not all:
            self.response.out.write('sss')
            return
        self.response.out.write(all)

this is my web page :

alt text

when i choice 'signup' and 'login', it only show 'signup',

alt text

so how to get all data from checkbox using python on gae ..

thanks

updated:

it is ok now ,two ways :

1. all=self.request.get_all('automail')

2. all=self.request.get('automail',allow_multiple=True)

+2  A: 

If multiple arguments have the same name, self.request.get returns the first one.

You want get_all.

Drew Sears