Jamroom Logo Jamroom 5 Core
is now Open Source!
User Support Forum Archive (Read Only)
Jamroom Developers:
return error to form
elygen



Joined: 22 Feb 2007
Posts: 637

Posted: 03/12/11 11:41 
Im using a hook in song_modify.
If i find an error in the form how do i send the error back to the form when the submission is complete


_________________
~ Todd
=================
Happy Jamrooming
New Jersey
www.bandarray.com
Back to top
smith.kyle
CodeSmith


Joined: 27 Apr 2006
Posts: 22009
Location: Southern California

Posted: 03/12/11 15:12 
I'm not quite sure what you mean - can you clarify or post an example?

Kyle


_________________
kyle[at]jamroom.net

Yes...that's a soda machine...

I get bored when no one's posting...
Back to top
elygen



Joined: 22 Feb 2007
Posts: 637

Posted: 03/12/11 19:07 

smith.kyle:
I'm not quite sure what you mean - can you clarify or post an example?

Kyle


Sure,

I have a custom form field in songs. I want to make sure that if they have the radio set to yes for the custom form field they have a location set. If the band does not have a location set then this radio option can not be set to yes. So i want the song to update or create but keep this radio set to no and pass a notice that this option was not set to yes because a location for your band is not set


Code

if($_REQUEST['custom_form_field']) == 'yes' {
    $req = "SELECT band_location
      FROM {$jamroom_db['band_info']}
      WHERE band_id = {$_user['user_band_id']}";
    $_rt = dbQuery($req,'SINGLE');

    if(!isset($_rt['location']) || $_rt['location'] == "") {
        $_REQUEST['custom_form_field'] = 'no';
        //here i want to pass a notice to the song.php script so it will create/modify the song but leave this option as no and show a notice/warning to the user why it was not set to yes
    }

}



Hope this makes more sense


_________________
~ Todd
=================
Happy Jamrooming
New Jersey
www.bandarray.com
Back to top
smith.kyle
CodeSmith


Joined: 27 Apr 2006
Posts: 22009
Location: Southern California

Posted: 03/12/11 22:52 
Ahh - you would use jrSetFormNotice and then jrlocation back to the referring page:

http://www.jamroom.net/Function_jrSetFormNotice

Note that none of the form values will be saved to the session, so you might need to do that in your hook as well.

Kyle


_________________
kyle[at]jamroom.net

Yes...that's a soda machine...

I get bored when no one's posting...
Back to top
Display posts from previous:   
User Support Forum Archive (Read Only)
Jamroom Developers

 
Solutions
• Social Media Platform
• Social Networking Software
• Musician Website Manager
• Community Builder
Products
• Jamroom Core
• Jamroom Addons
• Jamroom Modules
• Jamroom Marketplace
Support
• Support Forum
• Documentation
• Support Center
• Contact Support
Community
• Community Forum
• Member Sites
• Developers
Company
• About Us
• Contact Us
• Privacy Policy
©2003 - 2010 Talldude Networks, LLC.