61
jcera
html question
  • 2004/6/14 0:17

  • jcera

  • Just popping in

  • Posts: 72

  • Since: 2004/6/5 6



i want my template to have two drop down boxes. the first one should display the coountry and the second one should display the different cities within the coountry, depending on the selected country.

this is my code:
<select name = "country" onchange = "submit()"><{html_options values = "$index" output = "$country"}></select>
<select name = "city"><{html_options values = "$index" output = "$city"}></select>

where,
country[0] = "A", country [1] = "B"
index[0] =0, index[1] =1
city[0] = "a", city[2] = "b"

my problem is, when i select an option, although the page refreshes, it does not send the value of the country, therefore causing the second drop down box to be empty.

am i using the wrong function? i'm thinking of creating a function that will do this. however, i might just be creating one that's like select(), maybe i'm just missing a command or something. can anyone shed light on my problem? thanks!



62
jcera
Re: <select name = "name"><{$optionsarray}></select>
  • 2004/6/13 14:52

  • jcera

  • Just popping in

  • Posts: 72

  • Since: 2004/6/5 6


thanks! i solved this one. it turned out i was trying to input the wrong value. plus, i used the implode array function, which is why they're all in the same index.



63
jcera
Re: <select name = "name"><{$optionsarray}></select>
  • 2004/6/13 13:36

  • jcera

  • Just popping in

  • Posts: 72

  • Since: 2004/6/5 6


..and by the way..

i tried the following, too:

<select name = "name"><{html_options values = $optionsarray}></select>

..but i still get a blank dropdown box.



64
jcera
<select name = "name"><{$optionsarray}></select>
  • 2004/6/13 9:18

  • jcera

  • Just popping in

  • Posts: 72

  • Since: 2004/6/5 6


hi. i wrote that script in my XOOPS template but my drop down box is still empty.

using the smarty debugger, it says that my smarty variable is not empty. i'm supposed to get 4 options:

A
B
C
D

..and by the way, all four belong only to one index. this is what it looks like:

$optionsarray[0] = A,B,C,D

can anyone help me?



65
jcera
syntax error: unrecognized tag: (Smarty_Compiler.class.php, line 382)
  • 2004/6/9 10:14

  • jcera

  • Just popping in

  • Posts: 72

  • Since: 2004/6/5 6


the following was declared in my html script:

First Name: <input type="text" value="<{$var}> name ="firstname">

...and the following was declared in the php script between the include header and footer statements:

$variable = $_POST['variable'];
xoopsTpl->assign('variable', $variable);


but when i try to load the page, instead of diaplying First Name and the text box, i get the following errors:

1. Notice [PHP]: Undefined index: var in file C:\Program Files\Apache Group\Apache2\htdocs\html\modules\c_employee\index.php line 21

2. Error [Xoops]: Smarty: [in db:add_employee1.htm line 29]: syntax error: unrecognized tag: (Smarty_Compiler.class.php, line 382) in file C:\Program Files\Apache Group\Apache2\htdocs\html\class\smarty\Smarty_Compiler.class.php line 1824


i figured that the reason for error # 1 is that the html page did not load, thereby not setting the index of the variable var. however, for # 2, i have no idea. did i use the wrong smarty tags?



66
jcera
clueless
  • 2004/6/9 1:33

  • jcera

  • Just popping in

  • Posts: 72

  • Since: 2004/6/5 6


also...can i add new modules to my XOOPS without using smarty? or am i forced to use it?



67
jcera
clueless
  • 2004/6/9 1:30

  • jcera

  • Just popping in

  • Posts: 72

  • Since: 2004/6/5 6


i want to add a new module "YOU INFO" for my site. i know how to add and install a new module. the problem is, i don't know how to dispaly them correctly. i'm trying with the simplest:

1. enter the your first name, last name and address in the text boxes.
2. click the cubmit button
3. after clicking, it should return the values you entered in the text field.

i'm clueless! i'm new to php, and i've have read about smarty as far as the crash course.

i have gone as far as accessing my "YOUR INFO" module. the user can enter and submit the data. i have a php file that will handle this, but the thing is, it is not displayed. can you help?



68
jcera
Re: http://yoursite.com/ - page cannot be displayed
  • 2004/6/6 1:51

  • jcera

  • Just popping in

  • Posts: 72

  • Since: 2004/6/5 6


thanks, ajaxbr!



69
jcera
Re: http://yoursite.com/ - page cannot be displayed
  • 2004/6/6 0:36

  • jcera

  • Just popping in

  • Posts: 72

  • Since: 2004/6/5 6


oh, come on, you guys! thanks, Mithrandir.



70
jcera
Re: http://yoursite.com/ - page cannot be displayed
  • 2004/6/5 10:03

  • jcera

  • Just popping in

  • Posts: 72

  • Since: 2004/6/5 6


woohoo! it was successful. thanks for the wakeup call.




TopTop
« 1 ... 4 5 6 (7) 8 »



Login

Who's Online

238 user(s) are online (160 user(s) are browsing Support Forums)


Members: 0


Guests: 238


more...

Donat-O-Meter

Stats
Goal: $100.00
Due Date: May 31
Gross Amount: $0.00
Net Balance: $0.00
Left to go: $100.00
Make donations with PayPal!

Latest GitHub Commits