Now I need the following search structure in the theme:
<div class="sideCol">
<aside class="siteSearch">
<form name="searchform" action="search" class="searchPage searchform" id="searchform">
<fieldset>
<legend>Website durchsuchen</legend>
<input class="searchPage text lang-de" name="SearchableText" type="text" size="25" title="Website durchsuchen" value="" placeholder="Suchbegriff..." />
<button type="submit"><i class="icon-search"></i></button>
</fieldset>
</form>
</aside>
</div>
All I need to get from Plones sunburst theme is the action link for the form element.
So I tried this:
<replace css:content-children="#portal-searchbox">
<xsl:variable name="action_link" select="form/#action" />
<form name="searchform" action="search" class="searchPage searchform" id="searchform">
<xsl:attribute name="action">${action_link}</xsl:attribute>
<fieldset>
<legend>Website durchsuchen</legend>
<input class="searchPage text lang-de" name="SearchableText" type="text" size="25" title="Website durchsuchen" value="" placeholder="Suchbegriff..." />
<button type="submit"><i class="icon-search"></i></button>
</fieldset>
</form>
</replace>
<replace css:content-children="#portal-searchbox" css:theme-children=".siteSearch" />
The problem ist that all I get in the theme is the structure of Plones Sunburst Search.
<div class="sideCol">
<aside class="siteSearch">
<form id="livesearch0" action="http://localhost:8080/mamuz/de/##search">
<div class="LSBox">
<label class="hiddenStructure" for="searchGadget">Website durchsuchen</label>
<input name="SearchableText" type="text" size="18" title="Website durchsuchen" placeholder="Website durchsuchen" accesskey="4" class="searchField" id="searchGadget" autocomplete="off">
<input class="searchButton" type="submit" value="Suche">
<div class="searchSection">
<input id="searchbox_currentfolder_only" class="noborder" type="checkbox" name="path" value="/mamuz/de/impressum">
<label for="searchbox_currentfolder_only" style="cursor: pointer">nur im aktuellen Bereich</label>
</div>
<div class="LSResult" id="LSResult">
<div class="LSShadow" id="LSShadow"></div>
</div>
</div>
</form>
<div id="portal-advanced-search" class="hiddenStructure">
Erweiterte Sucheā¦
</div>
</aside>
</div>
I'm familiar with diazo but pretty new to xslt. What is wrong? I tired several types of placements like import before it gets modified. Nothing helps.
Using the replace directive on attribute itself should work:
<replace attributes="action"
css:content="#portal-searchbox form"
css:theme="#searchform" />
Related
I have input fields that lower label when something has been typed in it.
paste bin css
<div class="form__group">
<input type="text" class="form__input" id="name" placeholder="Full name" required=""
autocomplete='off' />
<label for="name" class="form__label">Full Name</label>
</div>
But, when I use django forms, they don't work at all
<div class="form__group col">
{{createSet.title}}
<label for="id_title" class="form__label">Title</label>
</div>
I have recently tried to learn Django and I want to know it's possible to insert multiple input with this form structure to table database? if it's possible, can you tell me how it is? Thank you!!!
<form class="log-in" method="POST" enctype="multipart/form-data">
{% csrf_token %}
<div>
<input type="text" name="title">
<input type="file" name="image">
</div>
<div>
<input type="text" name="title">
<input type="file" name="image">
</div>
<div>
<input type="text" name="title">
<input type="file" name="image">
</div>
<button type="submit" class="btn btn-info">Submit</button>
</form>
What you are looking for are formsets: docs.djangoproject.com/en/3.0/topics/forms/formsets
This question already has answers here:
Regex select all text between tags
(23 answers)
Closed 2 years ago.
<form action="/facial-sas/#wpcf7-f158-p566-o1" method="post" class="wpcf7-form cf7-style" novalidate="novalidate">
<div style="display: none;">
<input type="hidden" name="_wpcf7" value="158">
<input type="hidden" name="_wpcf7_version" value="5.1.9">
<input type="hidden" name="_wpcf7_locale" value="en_US">
<input type="hidden" name="_wpcf7_unit_tag" value="wpcf7-f158-p566-o1">
<input type="hidden" name="_wpcf7_container_post" value="566">
</div>
<div class="row">
<div class="small-12 columns">
<label>Select Department</label> <span class="wpcf7-form-control-wrap menu-78"><select name="menu-78" class="wpcf7-form-control wpcf7-select wpcf7-validates-as-required" aria-required="true" aria-invalid="false"><option value="Stem Cell Treatments">Stem Cell Treatments</option><option value="Hair Restoration">Hair Restoration</option><option value="Face & Body">Face & Body</option><option value="Aesthetics">Aesthetics</option><option value="Vaginal Rejuvenation">Vaginal Rejuvenation</option></select></span>
</div>
<div class="small-12 columns">
<label>Your Name</label> <span class="wpcf7-form-control-wrap your-firstname"><input type="text" name="your-firstname" value="" size="40" class="wpcf7-form-control wpcf7-text wpcf7-validates-as-required full" aria-required="true" aria-invalid="false"></span>
</div>
<div class="small-12 columns">
<label>Phone</label> <span class="wpcf7-form-control-wrap phone"><input type="text" name="phone" value="" size="40" class="wpcf7-form-control wpcf7-text wpcf7-validates-as-required full" aria-required="true" aria-invalid="false"></span>
</div>
<div class="small-12 columns">
<label>E-mail</label> <span class="wpcf7-form-control-wrap email"><input type="text" name="email" value="" size="40" class="wpcf7-form-control wpcf7-text wpcf7-validates-as-required full" aria-required="true" aria-invalid="false"></span>
</div>
</div>
<div class="row">
<div class="small-12 columns">
<div id="cf7sr-5efbe15251408" class="cf7sr-g-recaptcha" data-theme="light" data-type="image" data-size="normal" data-sitekey="6Lcfm80UAAAAAARwri_XthNlglRc51eYQiyfEAGL"></div><span class="wpcf7-form-control-wrap cf7sr-g-recaptcha-invalid"></span><br>
<input type="submit" value="MAKE AN APPOINTMENT" class="wpcf7-form-control wpcf7-submit btn full accent"><span id="wpcf7-5efbe1525136e" class="wpcf7-form-control-wrap honeypot-678-wrap"><label class="hp-message">Please leave this field empty.</label><input class="wpcf7-form-control wpcf7-text" type="text" name="honeypot-678" value="" size="40" tabindex="-1" autocomplete="nope"></span>
</div>
</div>
<div class="wpcf7-response-output wpcf7-display-none" aria-hidden="true"></div></form>
In above code I want to find and replace between this two tag first opening tag "<form action="
and closing tag anything between changes on all my website pages. how do I select this all between this two tags and replace with some other code. please help me to find regex expression for find and replace in visual studio code.
thanks,
coder
You could use this pattern /(?<=[<fo]rm).+(?<![>])/g
str='<form action="/facial-sas/#wpcf7-f158-p566-o1" method="post" class="wpcf7-form cf7-style" novalidate="novalidate">'
pattern=/(?<=[<fo]rm).+(?<![>])/g
console.log(str.match(pattern)[0])
A login form is submitted and when I try and dump the values the form structure is empty in IE but not FF or Chrome. This is in a DEV environment using HTTPS and a corporate self signed certificate.
I don't really think this is Fusebox related but it is the framework I'm using. No choice in the matter as it is legacy code and no budget to change it so please don't suggest I move on.
I've discovered that in IE it doesn't like the form action to be of the format:
/directory/index.cfm?fuseaction=app.Security
Instead it wants a fully qualified action
https://www.mycompany.com/directory/index.cfm?fuseaction=app.Security
<form action="/directory/index.cfm?fuseaction=app.Security" name="loginForm" id="loginForm" method="post">
<div style="width:55%;" align="center" id="fieldset">
<fieldset class="border" style="width:70%;">
<legend>Login</legend>
<div style="padding:2%">
<label for="userID">User ID: <span id="error1" class="redbold" aria-live="assertive"></span> </label>
</div>
<div>
<span class="required">*</span> <input type="text" name="userID" id="userID" size="32" maxlength="8" value="" />
</div>
<div style="padding:2%">
<label for="pw">Password: <span id="error2" class="redbold" aria-live="assertive"></span></label>
</div>
<div>
<span class="required">*</span> <input type="password" name="pw" id="pw" size="32" maxlength="20" value="" />
</div>
<div style="padding:2%" id="formButtons">
<input type="submit" value="Login" class="buttonfield" title="Login to eAgenda" />
<span style="padding-left:5%; margin-left:5%">
<input type="reset" value="Clear" class="buttonfield" title="Clear" />
</span>
<div id="errorMsg">
<p>
<span class="redbold"></span>
</p>
</div>
</div>
<span class="required">*</span>Mandatory field
</fieldset>
</div>
</form>
In the end it was a <base href="http://..."/> tag in the header. Removing or making it https solved the problem.
I am having problems with my ColdFusion code returning "Element AUTHOR is undefined in FORM." whenever I submit my form. I've tried using <cfparam> to set comment.author but it didn't work either. I'm fairly new to ColdFusion so any reasoning comments would be great too!
<cfparam name="form.submitted" default="0" />
<cfset blogPost = EntityLoad('BlogPost',url.id,true) />
<cfif form.submitted>
<cfset comment = EntityNew('BlogComment') />
<cfset comment.author = form.author />
<cfset comment.comment = form.comment />
<cfset comment.createdDateTime = now() />
<cfset blogPost.addComment(comment) />
<cfset EntitySave(blogPost) />
</cfif>
<cfimport taglib="customTags/" prefix="layout" />
<layout:page section="blog">
<!-- Content Start -->
<!--Card -->
<div id="content">
<div class="card-pattern">
<!-- blog -->
<div id="blog">
<div class="clr">
<div class="top-bg1">
<div class="top-left">
<div><h1>Blog</h1></div>
</div>
</div>
<div class="clr">
<div class="pat-bottomleft"> </div>
<div class="pat-bottomright"> </div>
</div>
</div>
<div class="blog-top">
<div class="clr">
<cfoutput>
<div class="left">
<!-- Blog Title -->
<h2 class="big">
#blogPost.title#
</h2>
<!-- Date Published -->
<h5>
<strong>Date Posted</strong>: #dateformat(blogPost.dateposted,'mm/dd/yyyy')#
</h5>
<!-- Blog Body -->
#blogPost.body#
<!-- Blog Export -->
<p>
<img src="assets/images/export_pdf.png" border="0"/>
</p>
<!-- Blog Comments Section -->
<h3>
Comments #arrayLen(blogPost.getComments())#
</h3>
<div class="clr hline"> </div>
<div class="clr comments">
<ul>
<!-- Start Comment -->
<cfloop array="#blogPost.getComments()#" index="comment">
<li>
<p>
<strong>Posted On:</strong> #dateFormat(comment.createdDateTime,'mm/dd/yyyy')# at #timeformat(comment.createdDateTime,'short')# By #comment.author#
</p>
<p>
#comment.comment#
</p>
<div class="clr hline"> </div>
</li>
</cfloop>
<!-- End Comment -->
</ul>
</div>
<h3>
Post Comment
</h3>
<div class="clr hline"> </div>
<div class="clr postComment">
<form action="BlogPost.cfm?id=#blogPost.id#" method="post" id="form">
<div>
<label>Name <span class="font-11">(required)</span></label>
<input name="contactname" type="text" class="required" />
</div>
<div class="textarea">
<label>Comment <span class="font-11">(required)</span></label>
<textarea name="comment" rows="6" cols="60" class="required"></textarea>
</div>
<div>
<input id="submitBtn" value="Submit" name="submit" type="submit" class="submitBtn" />
</div>
<input type="hidden" name="submitted" value="1" />
</form>
</div>
</div>
</cfoutput>
<div class="right" >
<h2>Categories</h2>
<!-- Blog Specific Categories -->
<div id="categories" align="center">
<ul>
<li>ColdFusion</li>
<li>Development</li>
</ul>
</div>
</div>
</div>
</div>
<div class="clr"></div>
</div> <!--blog end -->
</layout:page>
The error is telling you what is wrong. There is no author element in your form OR there is no form scope at all. Here is the form code that you posted:
<form action="BlogPost.cfm?id=#blogPost.id#" method="post" id="form">
<div>
<label>Name <span class="font-11">(required)</span></label>
<input name="contactname" type="text" class="required" />
</div>
<div class="textarea">
<label>Comment <span class="font-11">(required)</span></label>
<textarea name="comment" rows="6" cols="60" class="required"></textarea>
</div>
<div>
<input id="submitBtn" value="Submit" name="submit" type="submit" class="submitBtn" />
</div>
<input type="hidden" name="submitted" value="1" />
</form>
It only contains 4 elements: contactname, comment, submit and submitted. This means that after the form is submitted ColdFusion will have access to: form.contactname, form.comment, form.submit and form.submitted. I presume that you are trying to set your comment.author variable to the contactname form field.
You could either change your code where you are setting the variable, like this:
<cfset comment.author = form.contactname />
Or you could change your code where the form field is defined, like this:
<input name="author" type="text" class="required" />
Either way, the references to the form scope must match the names that you give them in your HTML form. For what it's worth, you can always dump the form scope after it is submitted to see what is available, like this:
<cfdump var="#form#">
Also remember to sanitize all data that you receive from the client.
How can I sanitize user input but keep the content of <pre> tags?
Agreed, undefined because it doesn't exist in the form.
And definitely sanitize all form and url data. One example below:
<cfset myVar = ReReplaceNoCase(#FORM.formfield#,"<[^>]*>","","ALL")/>