Jump to content

Search the Community

Showing results for tags 'submit'.

  • Search By Tags

    Type tags separated by commas.
  • Search By Author

Content Type


Forums

  • Welcome to ProcessWire
    • News & Announcements
    • Showcase
    • Wishlist & Roadmap
  • Community Support
    • Getting Started
    • Tutorials
    • FAQs
    • General Support
    • API & Templates
    • Modules/Plugins
    • Themes and Profiles
    • Multi-Language Support
    • Security
    • Jobs
  • Off Topic
    • Pub
    • Dev Talk

Product Groups

  • Form Builder
  • ProFields
  • ProCache
  • ProMailer
  • Login Register Pro
  • ProDrafts
  • ListerPro
  • ProDevTools
  • Likes
  • Custom Development

Find results in...

Find results that contain...


Date Created

  • Start

    End


Last Updated

  • Start

    End


Filter by number of...

Joined

  • Start

    End


Group


AIM


MSN


Website URL


ICQ


Yahoo


Jabber


Skype


Location


Interests

Found 5 results

  1. Hopefully this is pretty easy/quick. I have a signup form with name and email and on submit, a new page is created under "Entries". Is it possible to check if the name (which has two fields for first and last) and or the email is already registered and display an error?
  2. Hello, I'm wondering how to add the value of a field to a URL when submitting a form, while also processing the form with FormBuilder and storing the entry in the CMS. Is this even possible with the versions below? FB 0.2.5 | PW 2.7.2 Is there still a dedicated Form Builder forum here anymore?
  3. Hi guys, I have a requirement for a new input field for Form Builder. Essentially I just need to have some radio buttons which use an image as their label. I have managed to create the module, have it install automatically and create a new form with my custom input type but I am having trouble handling the image which is being uploaded as the label. The value for imageLabel is always an empty array. I have looked all around the forums and I Google but I cant find the answer close to what Im looking for. Do I handle the file upload manually and extract/add it to my imageField during POST and GET? I've tried multiple different methods and been through most of the API too but can't figure out the correct way to do this. <?php class InputfieldImageRadios extends InputfieldRadios { const CONFIGNAME = "ImageRadios"; public static function getModuleInfo() { return array( 'title' => __('Radio Buttons with Image Label', __FILE__), 'summary' => __('Radio buttons for selection of a single item with an extra image label', __FILE__), 'version' => 1, 'singular' => true, 'autoload' => true, 'requires' => array('InputfieldRadios', "FormBuilder") ); } public function init() { parent::init(); } public function ___getConfigInputFields() { $inputFields = parent::___getConfigInputfields(); $imageField = wire('modules')->get('InputfieldFile'); $imageField->label = $this->_('Image Label'); $imageField->description = $this->_('If you want the label to be displayed as an image.'); $imageField->extensions = 'jpg jpeg png gif'; $imageField->maxFiles = 1; $imageField->maxFileSize = 200000; $imageField->overwrite = false; $imageField->destinationPath = wire("config")->paths->files . "radioLabels/"; $imageField->name = "imageLabel"; $imageField->type = 'file'; $imageField->value = array(); $inputFields->add($imageField); return $inputFields; } public function set($key, $value) { if($key == 'imageLabel') { $test = 1; } return parent::set($key, $value); } /** * Install the module append to Form Builder config * */ public function ___install() { $formBuilderClass = "FormBuilder"; $this->verifyDependencies([$formBuilderClass]); $formBuilderConfig = wire("modules")->getModuleConfigData($formBuilderClass); if (in_array(self::CONFIGNAME, $formBuilderConfig['inputfieldClasses'])) { return; } $formBuilderConfig['inputfieldClasses'][] = self::CONFIGNAME; wire("modules")->saveModuleConfigData($formBuilderClass, $formBuilderConfig); } protected function verifyDependencies($classes) { foreach ($classes as $class) { if (!wire('modules')->isInstalled($class)) { $this->error(self::CONFIGNAME . " dependency not installed: $class"); } } } /** * Uninstall the module and remove from Form Builder config * */ public function ___uninstall() { $formBuilderClass = "FormBuilder"; $this->verifyDependencies([$formBuilderClass]); $formBuilderConfig = wire("modules")->getModuleConfigData($formBuilderClass); foreach ($formBuilderConfig['inputfieldClasses'] as $key => $value) { if ($value == self::CONFIGNAME) { unset($formBuilderConfig['inputfieldClasses'][$key]); } } wire("modules")->saveModuleConfigData($formBuilderClass, $formBuilderConfig); } }
  4. I need your advice! I recently launched my fathers site http://www.skulptour.eu which has a booking form on this page http://www.skulptour.eu/will-kommen/buchung/ The form is validated with the jQuery Validation Plugin and fires an ajax call for the booking-form-process.php (which sends the an notification e-mail to my dad) inside the submit handler of the plugin. Here is the code to demonstrate the structure /* * * contact-form.js * */ $(document).ready(function(){ //form var booking_form = $('#booking-form'); var booking_form_success = $("#booking-form-success"); //add workshop validation rule jQuery.validator.addMethod( "isworkshop", function(value, element) { return /^(W(O|E)|S)\s?\-?14\s?\-?\d{2}\s*?$/i.test(value); }, "Geben Sie eine Workshop-Kennnung ein. Beispiel: WO-1420 oder S-1421" ); //validate form booking_form.validate( { rules: { / .... / }, messages: { / .... / } }, highlight: function(element) { $(element).closest('.control-group').removeClass('has-success').addClass('has-error'); }, success: function(element) { $(element).closest('.control-group').removeClass('has-error').addClass('has-success'); $(element).closest('.error').remove(); }, submitHandler: function() { console.log("submitHandler: call ajax"); $.ajax({ url:'/site/mail/booking-form-process.php', data: booking_form.serialize(), type:'POST', success:function(booking_form) { console.log("submit Handler: ajax: sucess"); $("#booking-form").hide(); $("#booking-form-success").fadeIn(500,1); }, error:function(data) { $("#error").show().fadeOut(5000); } }); // ajax } // submitHandler }); // validate (jQuery Plugin) }); //doc ready Now i'd like to add a custom google analytics event tracker, which fires only if the ajax call is successfully executed. i already tried to add the following lines right after submitHandler: function () { //google analytics event console.log("submitHandler: google analytics call event"); ga('send', 'event', 'buchung', 'click', 'workshoptyp', 1); but it won't work. unfortunately i've no experience with the google analytics events yet and i updated my Analytics Account to use the new Universal.js, which itself is implemented properly. Do you guys have any ideas, how to solve this? Pseudocode: Booking Form > Validation w/ Errors > Ajax Call (Some php) > Ajax Call Successful > Fire Google Analytics Tracker Thanks in advance! - topada
  5. Hi y'all! Im am trying to force a file download after user submits a form. When user hits submit button POST data are send to a template (sort of "thank you for downloading" page). This template on successful submission redirects to another template through this code <?php $downloadurl = $pages->get('/download/')->url; header('refresh: 0; url='.$downloadurl); ?> Redirection then hits this template code (located in download template): <?php // filename & url of the pdf file $filename = $pages->get('/some-page/')->file->name; $fileurl = $pages->get('/some-page/')->file->url; $filesize = $pages->get('/some-page/')->file->filesize; // force download of the file header('Content-type: application/pdf'); header('Content-Disposition: attachment; filename='.$filename); header("Content-Length: ".$filesize); readfile($fileurl); It downloads a file and then redirects back to thank you page. The only problem is that the downloaded file is empty (0KB). When i download a file "the standard way" clicking on a link that directs to $pages->get('/some-page/')->plik->url; everything is ok. Any ideas?
×
×
  • Create New...