elclanrs / jq-idealforms-old

The ultimate framework for building and validating responsive HTML5 forms.
665 stars 95 forks source link

addFields value tag? #64

Closed wimogas closed 12 years ago

wimogas commented 12 years ago

Quick question,

How do you configure a value tag inside the addFields function? Or you can't?

Thanks!

elclanrs commented 12 years ago

This was previously only possible with list options such as radios, checkboxes or select dropdowns but I just updated the code to add a new option value where you can set the value of any field. It works like this:

$myform.addFields({ name: 'number', label: 'Number', type: 'text', value: '100' })

In case you want to set the value of an item in the list option, separate the item from the value with a colon :. This feature was already available:

$myform.addFields({ 
  name: 'list', 
  label: 'List', 
  type: 'radio',
  list: [ 'lorem:one', 'ipsum:two', 'dolor:three' ] // item:value
})
wimogas commented 12 years ago

Thanks! You rock man!

I'll buy you a virtual coffee as soon as possible ;)