]> _ Git - ccv-wordpress.git/commitdiff
wait #7041 @0:30
authorsoufiane <soufiane@cubedesigners.com>
Mon, 26 Aug 2024 16:08:07 +0000 (18:08 +0200)
committersoufiane <soufiane@cubedesigners.com>
Mon, 26 Aug 2024 16:08:07 +0000 (18:08 +0200)
wp-content/mu-plugins/cube/src/Forms/Builder/Fields/Text.php
wp-content/themes/CCV/resources/assets/styles/components/forms.styl

index be9a9791cec86f5babb444187191c0e5abc87829..4e27b31b713e6f7dde883b2eb79c42d5f9b44cd9 100644 (file)
@@ -7,6 +7,13 @@ use Cube\Forms\Builder\Field;
 class Text extends Field
 {
     public function render($settings) {
-        return '<input type="text" name="'. $this->get_name() .'" placeholder="'. $settings['placeholder'] .'" '. $settings['validation'] .'>';
+        $name = $this->name;
+        $type = "text";
+        $attr = "";
+        if(strstr($name,'link')) {
+            $attr = "data-parsley-type='url'";
+            $type = "url";
+        }
+        return '<input type="'.$type.'" name="'. $this->get_name() .'" placeholder="'. $settings['placeholder'] .'" '. $settings['validation'] . ' '.$attr.'>';
     }
 }
index f763bc99b14293f5790849116487838f76340d7d..17dbb1032cc895d6c40ff801fa4d13acb6e5630a 100644 (file)
@@ -28,7 +28,8 @@ input, textarea, select
 textarea
   @apply bg-white
 
-input[type="text"], input[type="email"], input[type="number"], input[type="password"], select
+input[type="text"], input[type="email"], input[type="number"], input[type="password"],
+input[type="url"], select
   appearance: none
   border: none
   border-radius: 0