Forum Moderators: coopster

Message Too Old, No Replies

option in form misses out space in querystring

         

jackvull

5:19 pm on Nov 22, 2007 (gmt 0)

10+ Year Member



I have an option dropdown in a form, which gets submitted via GET to the querystring.
One option has a space in it and the value is Central Services.
When it comes thrugh on the querystring it only says Central.
ANy ideas what to change?

It needs to be the full string as I also use it within a SQL database.
'Central Services'

tx

PHP_Chimp

5:53 pm on Nov 22, 2007 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Are you saying that when you print_r($_GET) it is only coming through as Central?

[edited by: PHP_Chimp at 5:56 pm (utc) on Nov. 22, 2007]

jackvull

6:12 pm on Nov 22, 2007 (gmt 0)

10+ Year Member



Yes.

PHP_Chimp

8:37 pm on Nov 22, 2007 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Humm odd....

If you change the method to post and try print_r($_POST) do you get the same problem?

jackvull

12:06 pm on Nov 26, 2007 (gmt 0)

10+ Year Member



nope still misses it:
the HTML is coming out like this:

<table>
<form action'reports.php' method='post'>
<tr>
<td colspan='3'>
<center>
<b>View ledgers</b>
</center>
</td>
</tr>
<tr>
<td>By controller:</td><td><select name ='ledgerbycontroller'>
<option value=Caroline Postings>Caroline Postings</option><option value=Chris Griffiths>Chris Griffiths</option><option value=Debbie Jordan>Debbie Jordan</option><option value=Janine Mallouppa>Janine Mallouppa</option><option value=Jennifer Parrington>Jennifer Parrington</option><option value=John Richards>John Richards</option><option value=Kerry Harford>Kerry Harford</option><option value=Lisa Mills>Lisa Mills</option><option value=Louise Dowdeswell>Louise Dowdeswell</option><option value=Michelle Wood>Michelle Wood</option><option value=Sue Fazey>Sue Fazey</option><option value=Sue Hill>Sue Hill</option><option value=Terry Dos Ramos>Terry Dos Ramos</option><option value=Val de Melo Koch>Val de Melo Koch</option></select>
</td><td><input type='submit' value ='Go'></td>
</tr>
<tr>
<td>Full ledger:</td><td>
<input type='hidden' name ='fullledger' value ='1'>
</td><td><input type='submit' value ='Go'></td>
</tr>
</form>
</table>

jackvull

12:07 pm on Nov 26, 2007 (gmt 0)

10+ Year Member



I just realised...
quotes round the value in the option element.

Habtom

12:07 pm on Nov 26, 2007 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



action'reports.php'

to

action='reports.php'