How to Validate Widget Input

I have been working with widgets and widgets API.

I see that the widget form is rendered and processed through widget() function. I can write validation logic inside the widget() function. I will do a isset($_POST) check and write the form handling logic in it.

Read More

Something like this:

function widget($args){

extract($args);

is isset(){$_POST['fieldname']

{  // form processing logic  }


// echo HTML Form

}

I would like to separate the form processing logic from the widget function. How can I achieve this? Is there a standard way for doing this?

Related posts

Leave a Reply

1 comment