Form Submit Buttons »  Show posts from    to     

Icy Phoenix


Old Support Topics - Form Submit Buttons



AndyGpy [ Sun 05 Jan, 2014 13:37 ]
Post subject: Form Submit Buttons
Hi All,

Up until now any new pages i have added via the documentation section on this webside , method 2 where i add a php page, a tpl page and then add a standard page has only contained information, i have now created a page and added a form, the form has a search box on it to search a database for a particular word.

The problemi am having is that when you press the search button, you are taken to the login page.

Form code is below

Code: [Hide] [Select]

<form>
<td width="56"><span class="style31">Family</span></td>
<td width="91"> <span class="style14">
<select name="REGION_FILTER" size="1" id="REGION_FILTER" >
<option value="AllRg">Select</option>
<option value="{REGION_FILTER}" /></option>
</select> </td>

<td width="123"><input type="submit" name="submit2" value="Search" method="GET" action="{FULL_SITE_PATH}{U_ticklist_main}" /></td>
<td width="126" class="style13"> <blink>NEW FEATURE </blink></td>
<td width="78"><div align="right">Look for...</div></td>
<td width="144"><input type="text" name="searchstring" id="searchstring" /></td>
<td width="59"><input type="submit" name="submit3" value="Find" method="GET" action="{FULL_SITE_PATH}{U_ticklist_main}" /></td>
</form>


Can someone please help


Mighty Gorgon [ Sun 05 Jan, 2014 21:13 ]
Post subject: Re: Form Submit Buttons
Hi Andy, the code you posted is quite broken under a semantic point of view.

You cannot add a form within a table row... you should add it before table definition, or within a table cell.

Plus you should add a method to the form and the file to be loaded when the form is submitted... you should take as reference any other form in Icy Phoenix template and try to replicate the code.

Also... how do you deal with submitted data?


AndyGpy [ Sun 05 Jan, 2014 23:42 ]
Post subject: Re: Form Submit Buttons
Thanks MG

Managed to stop it from requesting you to login each time submit is pressed

Code: [Hide] [Select]

<form action="{FULL_SITE_PATH}{SB_SEARCH}" method="post"><input name="submit" type="text" class="post search" style="width: 160px;" value="Search" onclick="if(this.value=='{L_SEARCH_THIS_TOPIC}')this.value='';" onblur="if(this.value=='')this.value='{L_SEARCH_THIS_TOPIC}';" /><input type="submit" class="mainoption" value="{L_SEARCH}" /></form></div>


Much appreciated pointing me in my errors.

One stupid question perhaps, if i now ping a database for the text in the submit box, with the data it brings back how can i make each record entry appear on screen as a hyperlink ?

Regards


Mighty Gorgon [ Tue 07 Jan, 2014 14:51 ]
Post subject: Re: Form Submit Buttons
AndyGpy wrote: [View Post]
One stupid question perhaps, if i now ping a database for the text in the submit box, with the data it brings back how can i make each record entry appear on screen as a hyperlink?

You need to deal with all data using a loop and assign for each entry some template vars and then output.

Take a look at ranks.php, referers.php or staff.php in latest Icy Phoenix package, just to get the idea.




Powered by Icy Phoenix