Single form for multiple actions

Trying to figure out how I can get this to work using one piece of code. I’m trying to use radio select buttons to provide the template and space name, but i’m not quite sure what i’m missing to make this work. Any ideas?

{{velocity}}    
#if("$!request.docName" != '')
      ## Request for creating a new instance
      #set($docName = ${request.docName})
      #set($targetDocName = "${request.spaceName}.${docName}.WebHome")
      #if(!$xwiki.exists($targetDocName) && $xwiki.hasAccessLevel('edit', $xcontext.user, $targetDocName))
        $response.sendRedirect($xwiki.getURL($targetDocName, 'inline', "template=${escapetool.url($request.template)}&parent=${escapetool.url($request.parent)}"))
        ## Stop processing, since we already sent a redirect.
        #stop
      #end
    #end

    #if("$!targetDocName" != '' && $xwiki.exists($targetDocName))
      {{warning}}The target document already exists. Please choose a different name, or [[view the existing document>>$targetDocName]]{{/warning}}
    #elseif("$!targetDocName" != '')
      {{warning}}You don't have permission to create that document{{/warning}}
    #end

    {{html}}
      <form action="" id="newdoc" method="post">
        <div>
          <input type="hidden" name="parent" value="${doc.fullName}"/>
          <input type="radio" name="template" value="Templates.Doc.Template.WebHome" name="spaceName" value=":.Documents" checked> New Document<br>
          <input type="radio" name="template" value="Templates.IssueTrack.Template.WebHome" name="spaceName" value=":.Issues"/> New Issue Tracker<br>
          <input type="radio" name="template" value="Templates.Meetings.Template.WebHome" name="spaceName" value=":.Meetings"/> New Meeting<br>
          <input type="hidden" name="sheet" value="1"/>
          <input type="text" name="docName" value="Name:" class="withTip" size="25"/>
          <span class="buttonwrapper"><input type="submit" class="button secondary" value="First Option"/></span>
        </div>
      </form>
    {{/html}}
{{/velocity}}

Untitled picture2