Question: Using javascript, I'm trying to do the following. I'll boil this down into it's simplest version.

I'd like to pass a variable from a text field to a URL, and have the URL be visited when the form is submitted.

1. user enters a number into a text input field "123"
2. user clicks the submit button
3. Browser redirects to <http://url.com/?myVariable=123> on click

The other question did not solve my problem because it didn't send a user-inputted variable.

Thank you.

Answer: 
There is some information missing as to how timedPump is evaluated. I guess it's a simple loop.

What needs to happen is there have to be two functions, one that sets a turnOff-time and one that evaluates weather to turn on / off the pump.
This can be implemented as two methods of a class:

```
class PumpControl(object):
    def setTime(self, val):
        now = datetime.now()
        self.timeOff=now + timedelta(minutes=int(val))
        print 'pumpOn'

    def checkTime(self):
        if self.timeOff < datetime.now():
            print 'pumpOff'

```

This way you would create a PumpControl object and then repeat checkTime:

```
controller = PumpControl()
#inside your loop
controller.checkTime()
#when you want to set the time
controller.setTime(val)

```

This should work across threads as well, so you can have one thread repeating and another asking for the time.
This sounds like something outside the scope of a single function. Either split the logic into two functions, or use a class to preserve `start_time`