| View previous topic :: View next topic |
| Author |
Message |
esoft_ian
Joined: 12 Sep 2005 Posts: 5275
|
Posted: Sun Nov 05, 2006 7:37 pm Post subject: |
|
|
Hi,
Yes they do. Just give them the same name as the field in the Events table. Everything else should take care of itself. |
|
| Back to top |
|
 |
smeallum
Joined: 17 May 2006 Posts: 177
|
Posted: Sun Nov 05, 2006 10:52 pm Post subject: |
|
|
fantastic...
this is a good example of how well designed Thyme is
Cheers,
NiCo |
|
| Back to top |
|
 |
smeallum
Joined: 17 May 2006 Posts: 177
|
Posted: Wed Dec 20, 2006 7:01 pm Post subject: |
|
|
| ian wrote: |
Hi,
It will probably require that you set this to the onKeyDown and/or onKeyUp event for the text box. In which case for your text box you would add a 3rd argument. Something like:
| Code: |
$_cal_form->textbox('myfield', 32,
"onKeyUp='only_numbers()' onKeyDown='only_numbers()'"); |
Where 'only_numbers()' is the javascript function you added. This function would go at the bottom of include/templates/event_edit_tpl.php.
Let me know if you have any more questions.
|
Hi ian...
i might be missing something for making my "price" custom field allow only numbers in event_edit. Maybe you spot it right away. This is what i have:
| Code: |
echo(' '._PRECIO_.''.$_cal_form->textbox('cust_precio', 32 , "onKeyUp='isDigit(event.KeyCode)' onKeyDown='isDigit(event.KeyCode)'"));
|
and at the bottom, the javascript function:
| Code: |
function isDigit(nKeyCode)
{
// Test for digit keycode (0-9).
if((nKeyCode > 47) && (nKeyCode < 58))
{
return true;
}
return false;
}
|
Any idea why i can still write letters in the field?
Cheers,
NiCo |
|
| Back to top |
|
 |
esoft_ian
Joined: 12 Sep 2005 Posts: 5275
|
Posted: Wed Dec 20, 2006 8:39 pm Post subject: |
|
|
Hi,
Off the top of my head.. no idea. Does Firefox show any errors in the Error Console? Tools -> Error Console |
|
| Back to top |
|
 |
smeallum
Joined: 17 May 2006 Posts: 177
|
Posted: Thu Dec 21, 2006 6:33 am Post subject: |
|
|
no errors in Firefox error console  |
|
| Back to top |
|
 |
esoft_ian
Joined: 12 Sep 2005 Posts: 5275
|
Posted: Thu Dec 21, 2006 1:13 pm Post subject: |
|
|
| Maybe the person who wrote that javascript has an idea of why it is not working. |
|
| Back to top |
|
 |
smeallum
Joined: 17 May 2006 Posts: 177
|
Posted: Thu Dec 21, 2006 2:07 pm Post subject: |
|
|
Like this it works:
| Code: |
echo(' '._PRECIO_.''.$_cal_form->textbox('cust_precio', 32 , "onKeyUp='return isDigit(event.KeyCode)' onKeyDown='return isDigit(event.KeyCode)'"));
|
i figured that out by comparing with another example i saw somewhere. The "returns" were missing.
Thanks
NiCo/SMeaLLuM |
|
| Back to top |
|
 |
|