Script Not working Vb.net - vb.net

Good afternoon , I'm trying to make the following script type " 1" on the site of the field, but I can not ... I'm using the script:
WebBrowser1.Document.All("donatePage:donateForm:amount").SetAttribute("value", "1")
<input id="donatePage:donateForm:amount" name="donatePage:donateForm:amount" size="20" type="text" value="1.00">

Related

I am passing a URL with area target, but everything past hashtag is missing

I have some links in my database that have area target in then using hashtag #. Example: www.mydomain.com/help/#howcanifixthis
When passing TXTurl www.mydomain.com/help/#howcanifixthis in a link and using Get in the form to input variable only www.mydomain.com/help/ shows up in the form. The hashtag and the area name is missing.
I have tried using htmlentities($TXTurl) and urlencode($TXTurl), and still no luck.
Here is the link the php where I am trying to pass the variable with the hashtag in it.
if($stmt->rowCount() > 0){
while($row = $stmt->fetch()){
echo "<p>" . $row["TXTlinkname"] . "</p>";
}
This is how I am inserting the links with hashtags into my database.
$sql = "INSERT IGNORE INTO TABLENAME (TXTlinkname, TXTurl)
VALUES ('$TXTlinkname', '$TXTurl')";
Here is the input fields that I am passing variables to...
<input type="text" name="TXTlinkname" value="' . htmlspecialchars($_GET["TXTlinkname"]) . '" id="TXTlinkname" class="form-control" placeholder="Type in Hyperlink Name Here..." autocomplete="off">
<input type="url" name="TXTurl" value="' . htmlspecialchars($_GET["TXTurl"]) . '" class="form-control" placeholder="Enter in the URL" autocomplete="on">
I want to be able to pass the URL variable in a link with the hashtag to the form. All My links in my database are to different URL's with the hashtag at the end of the link.
Anything past the # is not sent to he server, you can use GET variables though.

Trying to connect a HTML5 date input with date model

I have an HTML5 date input element like this:
<input type="date" />
if you choose a date in this input a string will be the value, for example:
"2018-12-31"
In my model I want the date to be presented as the following string:
"2018-12-31T00:00:00.000Z" and not the simplified string.
How do I make sure that the date in my model keeps the correct format? I tried using a computed but since I am in a loop this time I cannot use them.
{{eventDate.date}}
<b-form-input
v-bind:value="eventDate.date"
v-on:input="eventDate.date = $event.target.value"
v-bind:id="'event-day-date-' + index"
size="sm"
type="date"
placeholder="2018-12-31"
>
</b-form-input>
As you can see here the eventDate.date is a long string but the input needs the format YYYY-MM-DD. I need to convert it to and from this format some way.
You could use a filter:
filter: {
dateToString(date) {
return date.toString().substr(0,10)
}
}
and then update your template
:value="eventDate.date | dateToString"
This is what I ended up using:
<input
v-validate="'required'"
v-bind:name="'eventdate-' + index"
v-bind:value="eventDate.date | dateToString"
v-on:input="eventDate.date = $event.target.value + 'T00:00:00.000Z'"
v-bind:id="'event-day-date-' + index"
class="form-control form-control-sm"
type="date"
placeholder="2018-12-31"
/>

vee-validate regex does not work as expected

I am working with VUE and VEE-VALIDATE and want to check if an input is an valid decimal with comma as seperator.
My input with regex look like this:
<input type="text" v-model="myDecimal" v-validate:myDecimal="{ regex: /^(\d+|\d+,\d+)$/ }" :class="{'error': errors.has('mydecimal') }" ref="mydecimal" name="mydecimal" />
<span v-show="errors.first('mydecimal')" :class="{'field-validation-error': errors.has('mydecimal') }">NOT CORRECT DECIMAL!</span>
This works quite good for "1", "1,2", "0,4", "12,28761". Perfect!
Errors are displayed correctly for ",0", "foo", "1e". Perfect!
But if I type in the following I get NO error, but I would expect one: "1,1,1" or "1,1foo".
Any ideas what i am doing wrong?? Thanks!
Before (not working example):
<input v-model="myDecimal" v-validate:myDecimal="{ regex:/^([0-9]+|[0-9]+,[0-9]{0,2}?)$/ }" />
After (working example):
<input v-model="myDecimal" v-validate="{ regex:/^([0-9]+|[0-9]+,[0-9]{0,2}?)$/ }" />

vBulletin 4.x External Page Login and Variables

I've been searching around and experimenting with this for hours, with no success.
I'm trying to login to vBulletin from an external page. I've managed to get this to work. However what I can't get to work is showing the username and any of the $vbulletin variables.
I've included global.php chdir() to the forum etc etc, but I just can't get it to work.
Does anyone know how to go about this?
This is working example i'm using it. Its working fine. Its show user name and logout button on External page.
I don't know why -vote it.
<?php
$curdir = getcwd();
#Add your root dir below where it says "ADD ROOT" Example: /home/server/public_html/mainsite/forums
#Do not end with a "/" leave it open like above example.
chdir('ADD ROOT');
require_once('ADD ROOT/global.php');
chdir($curdir);
if ($vbulletin->userinfo['userid'] == 0) {
#Form Display Code, You can edit the way the Form is layed out here.
echo "<form id=\"login\" action=\"/forums/login.php?do=login\" method=\"post\" onsubmit=\"md5hash(vb_login_password, vb_login_md5password, vb_login_md5password_utf, 0)\">
<script type=\"text/javascript\" src=\"clientscript/vbulletin_md5.js?v=364\"></script>
Register
<label for=\"navbar_username\">Username</label>
<input type=\"text\" class=\"bginput\" style=\"font-size: 11px\" name=\"vb_login_username\" id=\"navbar_username\" size=\"10\" accesskey=\"u\" tabindex=\"101\" onfocus=\"if (this.value == 'User Name') this.value = '';\" />
<label for=\"navbar_password\">Password</label>
<input type=\"password\" class=\"bginput\" style=\"font-size: 11px\" name=\"vb_login_password\" id=\"navbar_password\" size=\"10\" tabindex=\"102\" />
<label for=\"cb_cookieuser_navbar\"><input type=\"checkbox\" name=\"cookieuser\" value=\"1\" tabindex=\"103\" id=\"cb_cookieuser_navbar\" accesskey=\"c\" />Remember Me?</label>
<input type=\"submit\" class=\"button\" value=\"Login\" tabindex=\"104\" title=\"Enter your username and password in the boxes provided to login, or click the 'register' button to create a profile for yourself.\" accesskey=\"s\" />
<input type=\"hidden\" name=\"s\" value=\"\" />
<input type=\"hidden\" name=\"do\" value=\"login\" />
<input type=\"hidden\" name=\"vb_login_md5password\" />
<input type=\"hidden\" name=\"vb_login_md5password_utf\" />
</form>";
#End Form Display Code
} else {
#Display after login completed
echo "Welcome Back, <b>".$vbulletin->userinfo['username']."</b>";
if ($vbulletin->userinfo['usergroupid'] == '6' ) {
echo " | My Profile";
echo " | AdminCP";
echo " | ModCP";
}
}
?>

How do I conditionally add an id attribute in TAL (PHPTAL)?

I'm creating a form elements template file in PHPTAL. I would like to be able to OPTIONALLY pass in an id attribute for a field...
So far the code looks like this:
<xml>
<tal:block metal:define-macro="text">
<label tal:condition="php: !isset(hideLabel) || isset(hideLabel) && !hideLabel">${field/label}</label>
<input name="${name}" type="text" value="${field/value}" />
<p tal:condition="exists:field/error">${field/error}</p>
</tal:block>
</xml>
This works as advertised. What I'd like to add is something, like
<input name="${name}" tal:attributes="id exists: id $id | $name" value="${field/value}" />
to allow me to optionally pass in an id from the METAL call...
Should I be doing it differently? I've tried using PHP: isset(id) ? $id : NULL and variations thereof, but just end up with an id="0" in the resultant HTML.
Any ideas?
In case anyone else needs it, one working answer is:
<xml>
<tal:block metal:define-macro="text">
<label tal:condition="not: exists:hideLabel">${field/label}</label>
<input name="${name}" tal:attributes="id id | nothing" type="text" value="${field/value}" />
<p tal:condition="exists:field/error">${field/error}</p>
</tal:block>
</xml>
Where passed in variables are id, name, an array named field, and hideLabel .
Note, that I've also managed to simplify the label test to something which I believe is more idiomatically TAL.
Set VAR at a DIV containing the soon to be used element:
div class="" tal:define="VAR context.property"
div class="" tal:attributes="class python:'grid_8 omega' if VAR else 'grid_8 alpha'"
in PHP:
<div id="contentCenter" tal:attributes="id
php:isset(variable)&&isset(variable.property)?'IDVALUE':NULL">