Hi Guys,
I have read through about 20+ forum posts - plus the tutorials - but something is just not clicking for me. So I thought I'd ask directly for help...
I'm using
- Jcook V2.0
- JS Framework:Jquery
- Embed Framework:No
- Form Style: Condensed
- Features: JDom Complete (so I don't get those todo graphics)
- Todo:No
- DB Auto: Model
I have a membership form. Its has these fields (amongst others)...
- State (ie: country state) (3 characters)
- Company Code (4 characters)
- Membership Type (2 characters)
- Membership Number
The Membership number is a string containing the State, Company Code, Membership Type and a sequential number. ie: NSW-JCOOK-ST-001
How do I auto-populate the Membership number in a Front end form? I'd like the form field to auto populate when the State, Company Code and Membership Type has been entered - but also allow the user to be able to override it with their own text.
Javascript would be the way - but I don't see where to add it in components/com_mycomponent/views/member/tmpl/member_form.php ?
Instead of seeing JDom calls, I see this...
// Iterate through the fields and display them.
foreach($fieldSet as $field):
//Check ACL
if ((method_exists($field, 'canView')) && !$field->canView())
continue;
// If the field is hidden, only use the input.
if ($field->hidden):
echo $field->input;
else:
?>
<dt>
<?php echo $field->label; ?>
</dt>
<dd<?php echo ($field->type == 'Editor' || $field->type == 'Textarea') ? ' style="clear: both; margin: 0;"' : ''?>>
<?php echo $field->input ?>
</dd>
<?php
endif;
endforeach;
I've given each field a class.
Also - can somebody send me a link to the available parameters with the form xml's (components/com_mycomponent/models/forms/member.xml )
Thanks in advance