Welcome Guest, Not a member yet? Register   Sign In
Using CI, Forms and Twitter's bootstrap
#1

[eluser]dstrickler[/eluser]
UPDATE: This may be an .htaccess problem - I am looking into it

SOLVED: I needed to be using method=post and not method=get

I have recently started (so I'm a newbie) using Bootstrap to recode a site I have. All was going well, but I went to code a page with a form and I am puzzled by the results when I submit the code below.
Code:
<form class="well form-inline" action="/tools/run" method="get">
<input class="input-large" type="text" name="domain" placeholder="Enter domain name here">
<button type="submit" class="btn">Run Report</button>
&lt;/form&gt;

I am trying to place a single field form on the screen with the field called "domain", and then press the "Run Report" button and have it submit the data from the "domain" field to a CI Controller called "tools.php" and the function called "run" inside that Controller. The $_POST should contain array("domain"=>"mydomain.com").

This all works well without Bootstrap, but with it, the tools page executes the "run" function in the Controller, but the URL looks like "http://localhost:8888/tools/run?domain=mydomain.com" when I entered in "mydomain.com" and pressed "Run Report" from the tools page form.

This looks like it's breaking the CI MVC model of passing in variables as parameters to the Tools. Any clues why this is happening? [/b]
#2

[eluser]Wuushu[/eluser]
Change
Code:
method="get"
to
Code:
method="post"

in the &lt;form&gt; tag


edit, noticed you found a solution Smile
#3

[eluser]dstrickler[/eluser]
One of those posts you put up and slap your forehead a moment later...




Theme © iAndrew 2016 - Forum software by © MyBB