arboles
arboles

Reputation: 1331

radio button form not sending data. what is the proper syntax?

what is the proper syntax for this radio button form i am POSTING. The form works fine without the radio buttons, its only when i add them, that i get an error saying, Undefined variable: where_to_search

<form action="" method="POST" >

<div class="control-group">
    <label class="control-label">Search By:</label>
        <div class="controls">
            <label class="radio">
                <input type="radio" name="where_to_search" id="optionsRadios1" value="1" checked>
                     Group Name
            </label>
                <label class="radio">
            <input type="radio" name="where_to_search" id="optionsRadios2" value="2">
                     Group Description
                </label>
            </div>
     </div>   


<input class="span2" name="keywords" id="appendedPrependedInput" size="15" placeholder="Search groups.." type="text"/><button class="btn" value="Go" type="submit">Go!</button>




</form>

Upvotes: 1

Views: 2409

Answers (2)

Simon Forsberg
Simon Forsberg

Reputation: 13351

You need to refer to the variable using $_POST:

$_POST['where_to_search']

Upvotes: 0

Jirka Kopřiva
Jirka Kopřiva

Reputation: 3099

Try: checked = "checked" and <input type="submit"

Upvotes: 1

Related Questions