CodeIgniter Forums
Prevent forms starting new line? - Printable Version

+- CodeIgniter Forums (https://forum.codeigniter.com)
+-- Forum: Archived Discussions (https://forum.codeigniter.com/forumdisplay.php?fid=20)
+--- Forum: Archived General Discussion (https://forum.codeigniter.com/forumdisplay.php?fid=21)
+--- Thread: Prevent forms starting new line? (/showthread.php?tid=35617)



Prevent forms starting new line? - El Forum - 11-04-2010

[eluser]umbongo[/eluser]
I have two forms which i want to be on one line. These point to different controllers so i have two instances of form_open() and form_close(). This currently is forcing at least two line breaks. How can i avoid this??

Also is it possible to submit a form with a plaintext link instead of a button??


Prevent forms starting new line? - El Forum - 11-04-2010

[eluser]dudeami0[/eluser]
For a plain text link you have to use javascript (Since this is not the intended use of a link). Also, mind showing an example of the form from the view? Would help with seeing the problem.


Prevent forms starting new line? - El Forum - 11-04-2010

[eluser]pickupman[/eluser]
This shouldn't matter what the form helpers are doing. Take a look at your CSS rules to make them be on the same line.


Prevent forms starting new line? - El Forum - 11-04-2010

[eluser]umbongo[/eluser]
Ok.. how is that done? I haven't touched CSS yet. There is no way to do it otherwise?

@dudeami0; theres really not much to it, but the relevant parts are essentially;
Code:
<?php
echo form_open('/a/b').form_hidden('from',uri_string()).form_submit('do','Do').form_close();
echo ' | '.form_open('/page/go').form_input('q','').form_submit('go', 'Go').form_close().' other stuff..';?>



Prevent forms starting new line? - El Forum - 11-04-2010

[eluser]dudeami0[/eluser]
Oh, I wasn't thinking visual (I thought you meant the form had random new lines showing up). You could add "display: inline" with CSS to the form.


Prevent forms starting new line? - El Forum - 11-05-2010

[eluser]pickupman[/eluser]
[quote author="dudeami0" date="1288942739"]Oh, I wasn't thinking visual (I thought you meant the form had random new lines showing up). You could add "display: inline" with CSS to the form.[/quote]
That's exactly right, by default a [url="http://w3schools.com/tags/tag_form.asp"]<form>[/url] tag is a block level element as explained by the html 4.01 specification