Welcome Guest, Not a member yet? Register   Sign In
set_value() alternate value...
#1

[eluser]evolutionxbox[/eluser]
I have a input with a set value in the value attribute but I want it to have a value in it already, then if required replace that with a user's value.

Code:
<input type="text" value="<?=set_value('text');?>" name="text" />

I was thinking of something like this:

Code:
<input type="text" value="<?=set_value('text', 'Type something here!');?>" name="text" />

The second value is the 'default' value which gets replaced by the user value when required.
Is there a way to do this without modifying the library?
#2

[eluser]Armchair Samurai[/eluser]
RTM again. Closely. Especially the part about the second parameter.
#3

[eluser]mattpointblank[/eluser]
Yep. That's exactly how it works.
#4

[eluser]evolutionxbox[/eluser]
Whoops... I missed that bit. =)




Theme © iAndrew 2016 - Forum software by © MyBB