CS1061 error in orchard captcha Modules - orchardcms

I'm getting error CS1061 in orchard captcha Modules(MainBit.Captcha)
#model MainBit.Captcha.ViewModel.CaptchaViewModel
<fieldset>
<label class="required">
#T("Type captcha")<br />
<img src="#(Model.Src)"/>
</label>
<input id="#(Model.ValueFieldName)" name="#(Model.ValueFieldName)" required="required" type="text" value="">
<input id="#(Model.GuidFieldName)" name="#(Model.GuidFieldName)" type="hidden" value="#(Model.Guid)">
#*#Html.TextBox(Model.ValueFieldName, "", new { required = "required" })
#Html.Hidden(Model.GuidFieldName, Model.Guid)*#
</fieldset>
<input id="#(Model.ValueFieldName)" name="#(Model.ValueFieldName)" required="required" type="text" value="">
<input id="#(Model.GuidFieldName)" name="#(Model.GuidFieldName)" type="hidden" value="#(Model.Guid)">
The 2 lines error:
1.CS1061 “CaptchaViewModel” does not contain “GuidFieldName” definition for and no “GuidFieldName”extension method accepting a first“CaptchaViewModel” argument of type could be found (are you missing a using directive or an assembly reference?)
2.CS1061 “CaptchaViewModel” does not contain “ValueFieldName” definition for and no “ValueFieldName”extension method accepting a first“CaptchaViewModel” argument of type could be found (are you missing a using directive or an assembly reference?)
I use vs2015 and Orchard 1.9.3.
Thanks for your help.

Related

How to print the third instance of an attribute using Cheerio JS

There is 3 instances of 'authenticity_token' in this html:
<form class="edit_checkout" action="/942252/checkouts/624527ae778897e534d917b52af2eb28" accept-charset="UTF-8" method="post"><input type="hidden" name="_method" value="patch" /><input type="hidden" name="authenticity_token" value="5vK3h2ocwaKm0hZ+AH3HAtnffe9l7hQHIMDfrMPusFhxtSV6IbLBfWOnBboOBysF7NyDPQ7GNxdfcWUPOk5WSQ==" />
<form class="edit_checkout" action="/942252/checkouts/624527ae778897e534d917b52af2eb28" accept-charset="UTF-8" method="post"><input type="hidden" name="_method" value="patch" /><input type="hidden" name="authenticity_token" value="Fkw7j/Wv0Xxhna1aWNh8FsZhNnXz4zu0vFuTV0q9WJ6BC6lyvgHRo6Tovp5WopAR82LIp5jLGKTD6in0sx2+jw==" />
<form class="edit_checkout" data-payment-form="" action="/942252/checkouts/624527ae778897e534d917b52af2eb28" accept-charset="UTF-8" method="post"><input type="hidden" name="_method" value="patch" /><input type="hidden" name="authenticity_token" value="Bs1PNacx4rK5TJcl+VDO+RXnR69DixOH+osJ/yxuQQeRit3I7J/ibXw5hOH3KiL+IOS5fSijMJeFOrNc1c6nFg==" />
The actual token (the value I want) is the value attribute and in this case I want the 3rd instance of 'authenticity_token'.
All 3 instances start with <form class="edit_checkout" but the third is followed by data-payment-form="" instead of action="/ . so I know the one I want is the one that includes data-payment-form
I tried using this code in Cheerio:
$('form.edit_checkout input['name="authenticity_token"']')
But that returns the first auth token on the first line and I need the auth token on the third line.
Thanks!
How about:
let input = $('[name="authenticity_token"]')[2]
Then to get the value:
let value = $(input).attr('value')

jsx error:: SyntaxError: Unexpected token / in /home/meditool/Bureau/med-tool/views/register.ejs while compiling ejs

i don't know why i have this error, i can't find the '/' can anyone help me please.
or tell me why this error can occurs, i spend all the day trying to resolve it ...
<% include ./partials/messages %>
<form action="/register" method="POST">
<div class="form-group">
<label for="first_name">First Name</label>
<input
type="name"
id="first_name"
name="first_name"
class="form-control"
placeholder="Enter first name"
value="<%= typeof first_name != 'undefined' ? first_name : '' %>"
/>
</div>
<div class="form-group">
<label for="last_name">Last Name</label>
<input
type="name"
id="last_name"
name="last_name"
class="form-control"
placeholder="Enter last name"
value="<%= typeof last_name != 'undefined' ? last_name : '' %>"
/>
</div> ...
Finnaly the error was catched, '<%- include('partials/messages.ejs') %>' this is the correct form to include a partial in ejs.

Some html tags are missing when i write to a file using python requests

I am trying to login to a website using requests.The website requies token for its login.
so decided to parse the html and write it to a file.txt But the file.txt is missing the token tag.
HTML code:
<form id="pw_form" class="exception_password" action="/409514769/password" method="post" data-xsrf-protection="enabled">
<input type="password" id="password" class="exception_password-input iris_input" name="password" placeholder="Enter password" autocomplete="off" data-validators="required">
<input type="hidden" name="is_review" value="">
<input type="hidden" name="is_file_transfer" value="">
<input type="submit" value="Submit" class="iris_btn iris_btn--primary">
<input type="hidden" name="token" value="4dc82c1a780e11667650f856da9b1d9fd31b176b.e7mu8nmqrb.1587446534"></form>
PYTHON code:
from requests import Session
with Session() as s:
site = s.get("https://vimeo.com/409")
with open('page.txt','w') as out:
out.write(site.text)
This is what the file writes:
<form id="pw_form" class="exception_password" action="/409514769/password" method="post">
<input type="password" id="password" class="exception_password-input iris_input" name="password" placeholder="Enter password" class="password iris_form_text" autocomplete="off" data-validators="required">
<input type="hidden" name="is_review" value="">
<input type="hidden" name="is_file_transfer" value="">
<input type="submit" value="Submit" class="iris_btn iris_btn--primary">
</form>
What is happening here?
Website don't allow request from bot.
One possible solution to this problem is to add headers while making the request.

Pyramid ignore missing template variables

I have a simple form using Pyramid and I want to use it as a new or update. I don't particularly want to have to create empty dictionary values for all the fields in my form, I just want it to ignore them without raising an exception.
<div metal:fill-slot="content">
<form method="POST" action="/studentupdate">
<input name="id" value="${studentid}" type="hidden" />
Name: <input type="text" name="studentname" value="${studentname}"/><br />
Exam Score: <input type="text" name="studentexam" value="${studentexam}"/><br />
Quiz Score: <input type="text" name="studentquiz" value="${studentquiz}"/><br />
Homework Score: <input type="text" name="studenthomework" value="${studenthw}"/><br />
<input type="submit" value="Save"/>
</form>
</div>
How can I do this?
Thanks.
You can workaround like this
${studentexam or ''}
% for i in missing_list or []
<li>${i}</li>
% endfor

Empty message with Formt in MODx

Here is my code of send-page:
<p>[[!FormIt?
&hooks=`email,FormItLog,spam,emailUser,redirect`
&emailTo=`heash94#gmail.com`
&emailSubject=`[[+subject]]`
&emailFromName=`[[+name]]`
&emailTpl=`ContactTpl`
&redirectTo=`62` ]]</p>
<div>[[+fi.error.error_message]]</div>
<form action="[[~[[*id]]]]" method="post"><input type="hidden" name="nospam:blank" value="" />
<div>
<label for="name">Name: </label> <input id="name" type="text" name="name:required" value="[[+fi.name]]" /> <span>[[+fi.error.name]]</span>
</div>
<div>
<label for="name">Email: </label> <input id="email" type="text" name="email:email:required" value="[[+fi.email]]" /> <span>[[+fi.error.email]]</span></div>
<div>
<label for="subject">Theme: </label> <input id="subject" type="text" name="subject:required:stripTags" value="[[+fi.subject]]" /> <span>[[+fi.error.subject]]</span></div>
<div>
<label for="message">Text: </label><span>[[+fi.error.message]]</span> <br /> <textarea id="message" name="message:required:stripTags" rows="7" cols="55">[[+fi.message]]</textarea></div>
<div>
<input type="submit" name="Submit" value="Отправить" /></div>
</form>
I tried many examples, but they send to my email empty messages.
Here is my reciver-page code:
This message [[+name]] ([[+email]]) was sand with callback form:
[[+message]]
But in response I have only "This message () was sent with callback form: ".
Modx Revolution.
Sounds like modx is not seeing the name="email:email:required" as 'email' - put your CSS/JS validation in another attribute & also use the &validate attribute for the formit call.

Resources