Submit Image Inside Input Form Field? - css

I was wondering, how can I use an image to submit a form (click the image to submit)? Also, can that image actually be inside the form field?

use input type image
http://www.w3schools.com/tags/att_input_type.asp

<img src="path/to/iamge.png">
Substitute "formName" for the name of your form.

Related

GTM - CSS Element

I'm wanting to create a variable to grab the username from a landing page (assuming it's possible). In my attached examples, I'd like to grab the text "Landing_page_test".
I'm just learning CSS so I'm not able to single out just that text.
Any thoughts/suggestions would be much appreciated! enter image description here
Console
Elements Pane of Landing Page
document.querySelector returns an element, not the text. Add .innerText
Try it out on this page: document.querySelector("a.question-hyperlink").innerText to get the name of the question.
But you probably don't want to do it as custom html tag. You probably want to do it on click. in that case, you have {{Clicked Element}} variable in GTM, of which you can also get .innerText, or get its .parentElement and further navigate DOM from the clicked element as you wish and get whatever you need.
Here's the html of the Location & Date/Time text blocks
Text Block

Can we create button in Drupal 7 without writing any code?

I want to create simple HTML button which links to other page when user clicks on it. I am new to Drupal, I've seen that we can create fields from "Structure>Content Types>Article>Manage Fields>Add new field - Field types.."
Can we create button from this way or we have to write code to create it?
Thanks
There is a beta module called Button Field that works with the Rules module. I believe will do what you're looking for. You can add a button to any fieldable entity and define a rule for it when it's pressed.
See https://drupal.org/project/button_field and https://drupal.org/project/rules
Buttons typically have to be coded. The way you're talking about above is the process for creating form elements for creating new pieces of content. If you want a simple button on a page to link to another page, you can just code it as follows:
<input type="button" value="Visit Another Page" onclick="location.href='your/other/web/page'" />
You may need to install a WYSIWYG text editor to add HTML to a page, if you don't already have one.
Or just use the Field Button module:
https://drupal.org/project/button_field
and create the buttons as you create fields...
With the help of views or webform, block module can create a button with out writing code.

ASP.NET hidden field vs. invisible textbox

what are benefits of using a hidden field in ASP.NET when we can use another invisible element such as label or text box?
The hidden field generate <input type="hidden" /> element on the page, which cannot be seen but the client can get the element, set the data and pass to the server:
document.getElementById('<%= SomeHiddenField.ClientID %>').value = "data_pass_to_server";
after postback you can get the value:
var clientData = SomeHiddenField.Value; // "data_pass_to_server"
If you're using invisible textbox (<asp:TextBox Visible="False" />), there's no element generated in the html file.
Either way works, for text box, don't use .visible="false"
use
yourTextBox.Style.Add("display", "none")
or
yourTextBox.Style.Add("visibility", "hidden")
A hidden field renders as input type="hidden" in the resulting HTML. Being an input the value in the input is submitted to the server on postback while this is not the case with a label. Depending on whether or not you want that value submitted to the server you should use input or label. If you don't want the value to be submitted then label is the right solution and hidden field is wrong.
I am not sure what you mean by invisible textbox but if you are trying to make it invisible via CSS keep in mind that the input type has semantic meaning to search engines, bots, etc. Also at some point your HTML might be served without CSS or with different CSS and the text box will become visible to the user. Otherwise there are no differences between hidden field and invisible text box as both of them render inputs.
Practically you can achieve the same thing with any of them, but since you want a "hidden field", semantically speaking the hidden field in ASP.NET is your best bet for readability reasons.

how to put the node:link token in the html a label?

i have installed the views and token module. i add a views field 'Node:Link' and check the 'exclude from display' option for the 'node:link' field and set the field first in the field order,now i want to overrite a views field.
i put this more >> in the rewrite the output of this field text box. but it can't work? [view_node] is the Node:Link token, how to make the more>> link ok? thank you
In the Node:Link field, enter more in Text to display: text box.
No need to put anchor tag just type [view_node] in the rewrite the output of this field text box.
Views has a built in way to make text link to other pages with tokens. I would use that instead of putting the anchor tag in the rewrite section. It's titled, "Output this field as a link"
If you're on Drupal 6 and you just want to link the field to it's node then just check the box "Link this field to it's node"

Resize textbox everytime to fit the text length

In my ASP.NET page I have a text box which shows data which is bind to an (JavaScript) object variable.
I want that textbox to resize everytime, the JavaScript object, e.g. result.title will change everytime.
Important:
I want to fit the textbox exactly to the text length inside.
Here is a great tutorial that teaches you how to make a jQuery plugin to do exactly what your talking about.
You could use onChange:
<textarea onChange="resize(this)"></textarea>
<script>
function resize(el) {
el.cols = el.value.length;
}
</scrip>
Btw are you using Ajax?
Here's a jQuery plug-in: http://www.unwrongest.com/projects/elastic/

Resources