2

I need to pass a value from a form to an external php script via a url, but my code isn't working. When I submit my form, I'm expecting the url to look like this: example.com/script.php?zip=12345 but what I'm getting is this: example.com/script.php? with nothing after the ?. My form code is below. Am I doing something wrong, or do I need to change a setting somewhere?

        <form id="map" method="get" action="script.php">
            <input type="text" class="inline" id="zip" />
            <input type="submit" class="button" value="Go" />
        </form>
  • 1
    I would say that this is not an ExpressionEngine-related question and is better server by StackOverflow. – Derek Hogue Dec 18 '12 at 16:54
2

You're missing the name attribute on the text field.

<input type="text" class="inline" id="zip" name="zip" />

You may just want to change id to name (that would depend on whether or not you're using the ID for any CSS/jQuery selectors).

| improve this answer | |
  • Doh! I must have looked at that code 100 times and not noticed that there was no name. Thanks. – artmem Dec 18 '12 at 16:54
  • No problem. For future reference Derek is right though. Any non-EE questions would be better off posted on Stack Overflow. – Dom Stubbs Dec 18 '12 at 17:26

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.