| View previous topic :: View next topic |
| Author |
Message |
JennK
Joined: 16 Jun 2006 Posts: 108
|
Posted: Sat Jun 24, 2006 2:48 am Post subject: Modifying event_edit_tpl.php |
|
|
This is getting more complicated than I thought it would (I am a designer not a programmer!)
Is it possible to add a dropdown list of locations and then create a javascript function that will populate the appropriate text boxes based on the response? I can write the function to create variables for the various location fields (i.e. addr_st, phone etc.) but I don't know how to integrate this with your code.
I see this
| Code: |
| $_cal_tmpl->section_row(_PHONE_, $_cal_form->textbox('phone', 30, "maxlength=30")); |
is it possible for me to add something like "value=$variable_set_by_function"?
And then is it possible to create another function that won't let the item be saved if the values for the location fields are null?
Sorry if this doesn't make sense ...
Thanks,
Jenn |
|
| Back to top |
|
 |
esoft_ian
Joined: 12 Sep 2005 Posts: 5275
|
Posted: Sat Jun 24, 2006 4:25 am Post subject: |
|
|
Hi Jenn,
I'm sorry. Could you elaborate please? I understand not letting people save if the boxes are not filled in, but the first part I'm not so clear on. |
|
| Back to top |
|
 |
JennK
Joined: 16 Jun 2006 Posts: 108
|
Posted: Sat Jun 24, 2006 5:29 am Post subject: |
|
|
Hi Ian,
Sorry I didn't make sense. I am trying to come up with a drop down list. In it are 3 locations (Location 1, Location 2, Location 3) and one choice for "other") I select location 1 and then the address is automatically filled out in the text box. Or I select "other" and nothing is put in the text box and I have to enter it myself.
What I am trying to do is sort of like your locations module, but less elegant for sure. But what I really need is the option to fill it in automatically, or the user can choose to type it in.
Most of my client's locations are going to be the same 3 locations over and over again so that is why I need a dropdown (like on your locations mod) ... but this calendar will be open to the public and that could be at any address to update and obviously they would have to personalize the address.
[code]
function changetext(Dropdown_Val, Dropdown_Val_SI)
{
switch (Dropdown_Val[Dropdown_Val_SI].value)
{
case 'Cheese' :
document.MyForm.TextField.value="Cheese";
break
case 'Ham' :
document.MyForm.TextField.value="Ham";
break
default :
document.MyForm.TextField.value="No Value";
break
}
}
//Normally I would have my form, select and text boxes here
[/code]
Does this make any more sense? |
|
| Back to top |
|
 |
esoft_ian
Joined: 12 Sep 2005 Posts: 5275
|
Posted: Sat Jun 24, 2006 1:34 pm Post subject: |
|
|
| It sounds like selecting the calendar option 'Remember locations' is exactly what you want. |
|
| Back to top |
|
 |
JennK
Joined: 16 Jun 2006 Posts: 108
|
Posted: Sun Jun 25, 2006 9:11 am Post subject: |
|
|
Remember Locations is ALMOST what I want. Can I specify what locations are remembered and lock them in (and keep others from getting added?)
And is there any way to set up an alert that says you must fill in location if the user hadn't?
If these questions are beyond the scope I understand ... |
|
| Back to top |
|
 |
|