php - saving values from an input field -


hi iam trying create wordpress plugin option page.i need create form input fields having default values in , when change value , save it, changed value should reflected in input filed , in variable assigned store value.

let me more precise

when change value of input field , save it should stored in assiged variable value( permanently till again change myself).

iam bit poor in form validation , php.help me out guys.

if you're ok working in newer browsers, use placeholder attribute on text field, supply placeholder disappear when focus , reappear when blur.

<input type="text" name="txtfield" value="" placeholder="input text" /> 

if want work in older browsers, in javascript:

<input type="text" name="txtfield" onfocus="if(this.value=='enter email')this.value=''" onblur="if(this.value=='')this.value='enter email'" > 

then can use <?php $value = $_post['txtfield'] ?> assign input value variable.


Comments

Popular posts from this blog

objective c - Change font of selected text in UITextView -

php - Accessing POST data in Facebook cavas app -

c# - Getting control value when switching a view as part of a multiview -