I am creating a macro with Excel VBA that will submit an entry into an online database using information from an Excel spreadsheet. During this entry process, the macro needs to click on a CSS button. It isn't a form button, does not have an input type, no name, no id, and no source image except for a background image. I think my only hopes are either to click on the button based on the div class. Can anyone help?
The button is here :
<div class="v-captiontext">
By Ankit
</div>
<td class="v-tabsheet-tabitemcell v-tabsheet-tabitemcell-selected" style="">
<div class="v- tabsheet-tabitem v-tabsheet-tabitem-selected">
<div class="v-caption" style="width: 39px;">
<div class="v-captiontext">
By LOT</div>
<div class="v-caption-clearelem">
</div>
</div>
</div>
</td>
Thanks to Remou's answer on this thread: Use VBA code to click on a button on webpage
Here is a first stab in your issue, you could try this:
Set tags = wb.Document.GetElementsByTagname("div")
For Each tagx In tags
If tagx.class = "v-caption-clearelem" Then
tagx.Click
End If
Next
Yet, I've never tried to use the Click method on a div.
Related
I want to style my Image Field Button (Choose File) with CSS. Currently, its displaying in the default theme. I am using Bootstrap V5.0.1, Django V3.2.12, Python 3.7.6.
First, I tried to identify or add a class or id which I can add and style the button regularly but was unable to add as the button was added by Django Image Field. The Code in my forms.py is given below:
from django import forms
class ImageUploadForm(forms.Form):
image = forms.ImageField(label='')
Then I used the Hover functionality of the Chrome Developer Tools to identify any leads and found that the button and its area had 2 id's #file-upload-button and #id_image.
I tried to add CSS to the above-mentioned id's but did not get the result i desired. I want to style the Choose File Button Below also if possible can i add any bootstrap to the button, any help would be appreciated! Thanks.
HTML-Django Code
<div class="form-group text-center">
<form method="post" enctype="multipart/form-data">
{% csrf_token %}
{{ form }}
<br>
<button type="submit" id="btnUpload" class="btn btn-primary" style="margin-top:20px;">Upload</button>
</form>
</div>
i was having the same problem and came upon this article https://www.quirksmode.org/dom/inputfile.html
The ideia is to create a useless button and add style to it, then overlap both with the image field button on top, and then set the opacity of the image button to 0.
The image field button will still work, but you will only see the button with the style you add.
The add button that appears over the 2sxc items is missing all of a sudden. It was there a couple days agao but now when I log into any portal in my DNN instance the "+" or add button is missing
here is a screen shot:
As you can see, the change layout and edit buttons are there. Not sure why the add button disappeared.
This is true for apps that I import from the 2sxc.org website as well. So I know its not just my template becasue it also happens on all the apps I have created which use different templates.
But to be thorough, here is my template code, its token based:
<div class="kr-gallery animation">
<p>Hover or touch image and click brush icon for more details</p>
<div class="isotope_grid isotope_grid2">
<div class="isotope_main animation" data-min-width="230">
<repeat repeat="Content in Data:Default">
<div class="isotope_item kr-gallery-item sc-element">[Content:Toolbar]
<div class="photo"><a href="[Tab:FullUrl]/details/[Content:EntityId]"> <img alt="" src="[Content:Image]?h=500" />
<span class="fa fa-paint-brush"></span></a>
</div>
</div>
</repeat>
</div>
</div>
</div>
Any idea why this is?
UPDATE:
Here is my visual query:
SOLUTION:
Based on answer, I switched to razor because I am using a custom query. Here is my simple template code now:
#* this will show an "add" button if the current user is an editor *#
#Edit.Toolbar(actions: "new", contentType: "Image")
#{
// get all images as delived from the standard query
var images = AsDynamic(Data["Default"]);
}
<div class="kr-gallery animation">
<p>Hover or touch image and click brush icon for more details</p>
<div class="isotope_grid isotope_grid2">
<div class="isotope_main animation" data-min-width="230">
#foreach(var img in images)
{
<div class="isotope_item kr-gallery-item sc-element">#img.Toolbar
<div class="photo"><a href="#Link.To(parameters: "details=" + img.EntityId)"> <img alt="#img.Title" src="#img.Image?h=500" />
<span class="fa fa-paint-brush"></span></a>
</div>
</div>
}
</div>
</div>
</div>
The missing + is by design, because editors are used to the + adding an item right after the previous one. This behavior cannot be guaranteed with a query, as the order of things is determined by the query. It is even possible, that adding an item will not show up, if a query-parameter hides that item.
So the design pattern is to provide a separate + button. The easiest way is in razor, I believe the code is something like
#Edit.Toolbar(actions: "new", contentType: "your-content-type-name")
In Tokens it's a bit more messy, and you cannot conditionally check if a user has edit-permissions.
So I recommend you go the edit.toolbar way
You can also find an example of this in the blog app: http://2sxc.org/en/apps/app/dnn-blog-app-for-dnn-dotnetnuke
I could be wrong but did you recently experiment with the visual query designer? Because this could be the cause.
The most common reason is when you use a pipeline (visual query) to deliver data to a template, which is not assigned to this instance. Reason is that "add" in a instance-list of items add it to a specific position (like right after the first one). This isn't the same when you use data like a data base - as there is no sorting in that scenario. So if this is the cause, I'll help you more.
I've been trying to get data from a SQL file to populate a set template for a web page. When the user navigates through the database records, the page updates accordingly. The data will include image URLs so that a image will update and things like the alt tag caption and descriptive text should also update.
Its basically a customised gallery based on SQL (text) data.
The .ASP data controls seem very restrictive and even details and form view with templates make it difficult to get full customisation of the layout of data. It there a way to spread data from a database record around a page template (ie HTML/CSS styling) in a consistent manner while maintaining the flexibility of the database functionality?
I basically want to write a HTML layout and put tags in that are replaced by the current field of the database, eg in pseudo code:
<div class="style1"> <asp: SQL_Datafragment field="Title"> </div>
<div class="picframe">
<img src ="
<asp: SQL_Datafragment field="Image_URL">
"/> />
</div>
<div style = "caption"> <asp: SQL_Datafragment field="Caption"> </div>
<div style = "spacer"><div>
<div style = "pictxt"> <asp: SQL_Datafragment field="Description"> </div>
And have a navigation control at the bottom like a prev and next field.
Is this possible?
Many thanks.
Kw
How do I get the html content of a template? For example, I have the following template:
<template name="test">
<div id="example">
<strong>This is a test.</strong>
</div> <button id="btn">Get</button></template>
I need the event click of button the HTML contents of the div # example is captured. it possible?
You could use JQuery (already built into meteor) for this
var html = $('#example').html();
As of Meteor 1.x, you can use Blaze.toHTML(). It returns the HTML of the given Template as a String.
If you assign the click event using Template.test.events you should have all the data that template describess in your "this".
I have a problem with placing Facebook Like Button inside a DataList control. I want to dynamicly create a Like Button for every DataList element. The problem is that it does show up only in IE. It doesn't work in other browsers.
Here is the code placed inside DataList control:
<fb:like href="<%#"http://www.mojsekret.net/Komentarze.aspx?ID=" + Eval("ID")%>" send="false" layout="button_count" width="450" show_faces="true" font="">
<br>
</fb:like>
And here is the script attachment:
<div id="fb-root"></div>
<script src="http://connect.facebook.net/pl_PL/all.js#xfbml=1"></script>
So it is basic stuff generated from facebook dev site. Has anyone encountered similar problem? Please guys, help me.
BTW: I did the same thing with Google +1 button and it's working. Code:
<g:plusone href='<%#"http://www.mojsekret.net/Komentarze.aspx?ID=" + Eval("ID")%>'></g:plusone>
Try removing the <br> inside the fb:like tag. Also make sure you are only rendering one <div id="fb-root"> on your whole page.