11
earplane
Re: Disabling XoopsForm elements
  • 2006/12/9 18:51

  • earplane

  • Just popping in

  • Posts: 35

  • Since: 2002/10/1


Thanks!!! How come the only way to figure this out is to ask?



12
earplane
Disabling XoopsForm elements
  • 2006/12/9 16:18

  • earplane

  • Just popping in

  • Posts: 35

  • Since: 2002/10/1


Is there a way to disable or hide/show XoopsForm elements at runtime?

I've got a form that contains time info: Time starts with a XoopsFormDateTime element and has a duration that is set with a collection of radio buttons. But if the radio button "Custom" is chosen I'd like the user to set the duration in a new XoopsFormDateTime control that either has to become enabled or visible (if it's been hidden so far).

This is easily done with "onclick" javascript if I do things from scratch, but is it possible to do this using XoopsForms?



13
earplane
Re: XoopsFormDateTime problems
  • 2006/10/16 23:33

  • earplane

  • Just popping in

  • Posts: 35

  • Since: 2002/10/1


Yes, I got some js errors, and also when loading the page. So I tried switching to the default theme, and suddenly everything works. Problem solved, but now I think it's time to rewrite my theme from scratch

Thanks, Mith, thread closed and no bugs found



14
earplane
Re: XoopsFormDateTime problems
  • 2006/10/16 18:54

  • earplane

  • Just popping in

  • Posts: 35

  • Since: 2002/10/1


Bump.

No replies. Does this mean that I should just forget about using XoopsForm and start building forms manually?
require_once XOOPS_ROOT_PATH."/class/xoopsformloader.php";    
$dateForm = new XoopsThemeForm("Set date"'setDate'XOOPS_URL."/path/to/my/file.php"POST);
$dateForm->addElement(new XoopsFormDateTime("Date: "'setDate'));
$dateForm->addElement(new XoopsFormButton(""'setDate''Submit''submit'));
$dateForm->display();

This code will work OK in XOOPS 2.0.x in Firefox and IE, but in Opera the popup ignores mouse input (though it still works with arrows and enter).

In XOOPS 2.2.x the calendar control isn't properly initialised (the text field shows YYYY/MM/DD instead of today's date). When I click the button the popup calendar will show in Firefox and Opera, but not in IE. The calendar will seem to work in both Firefox and Opera (keyboard response only in Opera), but no response is sent back to the webpage (probably because of the init problems). I also suspect that the init problem is why it won't show in IE.

So, either things must be broken in 2.2.x or there must be something wrong with my setup. Questions:

1. Is this a known problem?
2. If so, is there a way to solve it while using the XoopsForm classes?

Hope so,
Earplane



15
earplane
XoopsFormDateTime problems
  • 2006/10/13 9:09

  • earplane

  • Just popping in

  • Posts: 35

  • Since: 2002/10/1


Could somebody please confirm my findings?

1. XoopsFormDateTime don't work at all in XOOPS 2.2.x in any browser.
2. XoopsFormDateTime in 2.0.x don't take mouse input in Opera, but is OK in other browsers.

Am I right?

My site is stuck on xoops2.2.x and I really need a datepicker NOW. I like PiCal's use of the Dynarch JSCalendar, but then I'll have to get rid of my XoopsForm setup. I also haven't got it to work easily after skimming the instructions. So here are two more questions:

1. Does anyone have a wrapper class for the jscalendar that makes it XoopsForm ready? -or-
2. Could anyone write a quick and dirty step-by-step tutorial on how to incorporate a stock download of jscalendar into xoops?

Please feel free to move this posting if it doesn't fit here...



16
earplane
Re: XoopsThemeForm problem
  • 2006/9/21 15:12

  • earplane

  • Just popping in

  • Posts: 35

  • Since: 2002/10/1


Hi Dave_L,

Thanks! The unset() statement did the job. Perfect! But should it really be necessary? I find it strange.

(Sorry about the $sjekkboks, I translated my variable names in a hurry and I forgot one...)

Again, thanks, and cheers,
Earplane



17
earplane
XoopsThemeForm problem
  • 2006/9/21 9:20

  • earplane

  • Just popping in

  • Posts: 35

  • Since: 2002/10/1


I need to create a form dynamically, with checkboxes created in a for loop. Everything works fine on my localhost. However, when I transfer the code to the server I get problems: The form will show the correct number of checkboxes, but they all contain data from the last entry in the list. Code:

$form = new XoopsThemeForm('My form ''myName'$myPathPOST);          
for (
$i=0;$i<count($members);$i++)          
{              
    
$member $members[$i];
    
$name $member->Name();
    echo 
$name // This shows the correct name in both cases
    
$isPresent isPresent($member->ID());    
    
$checkbox = new XoopsFormCheckBox($name$member->ID(), $isPresent);
    
$checkbox->addOption(false" "); 
    echo 
$checkbox// this is OK on the localhost, and empty on the server
    
$form->addElement($sjekkboks);
}
$form->addElement(new XoopsFormButton(""'someName''Save','submit' )); 
$form->Display();


This will show the form with count($members) instances of the checkbox. On my localhost everything is fine, but on the server they're all filled with data from the last member.

Any idea, anyone?

(Note: we're not talking XOOPS members here, the member class is my own).



18
earplane
Re: Localhost problem
  • 2006/3/22 18:24

  • earplane

  • Just popping in

  • Posts: 35

  • Since: 2002/10/1


PROBLEM SOLVED!!!!!!!!!!

I went to the mainfile.php and switched the XOOPS_DB_PCONNECT flag from 0 to 1.

OK, back in business, thanks for helping, and I even learnt some new xoopscode. One question:

$uid 10;
$member_handler =& xoops_gethandler('member');
$user           =& $member_handler->getUser($uid);
$uname          =  $user->getVar('uname');

... is more code to write than...
$uid 10;
$user = new XoopsUser($uid);
$uname $user->getVar('uname');

... but should I do it anyway? Does the latter way put a heavier load on the server?



19
earplane
Re: Localhost problem
  • 2006/3/22 15:55

  • earplane

  • Just popping in

  • Posts: 35

  • Since: 2002/10/1


www.earplane.com

All shockwave-generated data is stored in a separate database, and results are stored with XOOPS userIDs. I want to get usernames from the XOOPS db after getting IDs from the other db.

Everything works online, but I can't get it to work on my offline localhost. And I don't like developing in public, I'm not that good...



20
earplane
Re: Localhost problem
  • 2006/3/22 12:28

  • earplane

  • Just popping in

  • Posts: 35

  • Since: 2002/10/1


OK, I've found out that things stop working when I make a call to a database other than the main XOOPS base (my site uses two databases). I tried placing mysql_close after each call, but it didn't help.

How do I reconnect to the XOOPS database after making a call to another one?

Or maybe: how should I set up my local MySQL to deal with this?




TopTop
« 1 (2) 3 »



Login

Who's Online

144 user(s) are online (104 user(s) are browsing Support Forums)


Members: 0


Guests: 144


more...

Donat-O-Meter

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

Latest GitHub Commits