Welcome Guest, Not a member yet? Register   Sign In
Clear value when refresh page
#1

[eluser]cinewbie81[/eluser]
I have few text input type elements on my form..
When User refresh the page, i want all the information / value in those elements to be cleared. how can i do it ?
I'm not sure if there's anything to do with codeigniter or not, anyone can please advise ? thanks.
#2

[eluser]sharpe[/eluser]
use a redirect() function.
#3

[eluser]cinewbie81[/eluser]
How am i going to know when the user 'refresh' the page ??
#4

[eluser]nirbhab[/eluser]
if you are generating the form through form helper than:

$data = array(
'name' => 'username',
'value' => '',
);

echo form_input($data);

this will clear all your fields data.

if your are using general html creation format like:

<input type="text" name="username" id="username" value="" />

than you can keep your value="" will clear its data.
#5

[eluser]cinewbie81[/eluser]
Hi,

I'm using

$data = array(
‘name’ => ‘username’,
‘value’ => ‘’,
);

echo form_input($data);


When the user fill up the value and press 'F5' to refresh the page, all the value is not clear ... i wonder why ...




Theme © iAndrew 2016 - Forum software by © MyBB