Reg: Placeholder in the search box - slickgrid

I have created a slickGrid APP and want to have placeholders in the search box. I can see an example in the Angular version of the slickgrid, yet couldnt see its code. I am however using the Javascript version.
Can someone help?
Thank you,
B

Check out http://6pac.github.io/SlickGrid/examples/example-header-row.html as an example.
The filter boxes are created using:
grid.onHeaderRowCellRendered.subscribe(function(e, args) {
$(args.node).empty();
$("<input type='text'>")
.data("columnId", args.column.id)
.val(columnFilters[args.column.id])
.appendTo(args.node);
});
So just add the 'placeholder' attribute to the box, eg:
<input type="text" name="fname" placeholder="First name">

Related

Form input old value in laravel 5.6

I have a search form input where i want to display the searchterm value in the searchbox after searching on the results page.
I tried the following which is not working
<input type="text" name="search" value="{{ old('search') }}" placeholder="Search help articles" class="form-control form-control-gray col-md-10">
What is incorrect in the value=""
old() is used when flashing data to the session. This is mostly used for forms which involve redirects back when something fails. Read about old input here.
request() should be used here since you're wanting to display the value that was submitted on that request.

kendo UI disable/enable required data rule

am using Kendo Ui for our MVC project and being very much new to kendoUI stuck with a problem where i need to disable/enable data-validate rule on one of my testbox on the basis of some business rules.
below is the HTML for control :
<pre><input id="txtLastName" type="text" data-tooltip="external" data-tooltip-text="tooltipdemotext" class="form-control k-textbox" data-validate="true" data-rule-message="Last Name cannot be blank" data-rule-name="required" placeholder="Enter Last Name" /></pre>
Could someone please help me in this.
And the answer was a single line statement of Jquery and nothing to do with Kendo
$('#txtLastName').removeAttr('data-validate');
Thanks

How to get value from a placeholder using xpath

All of the elements are dynamic. I can see only Placeholder which is unique from the following html:-
<input
id="ext-gen1617"
type="text"
size="20"
class="x-form-field x-form-text x-form-focus"
autocomplete="off"
aria-invalid="false"
placeholder="Gender"
data-errorqtip=""
role="textbox"
aria-describedby="combobox-1166-errorEl"
aria-required="true"
style="width: 78px;"
/>
I need to get the value displayed in
placeholder="Gender".
I tried using
//input[#placeholder='Gender']
But my webdriver script failed to identify it.
Can anyone please help me out with possible solution to it?
String s=driver.findElement(By.xpath("//input[#placeholder='Gender']")).getAttribute("placeholder");
System.out.println(s);
To get an attribute for a filed, you can use the .getAttribute() method.
I assume you are dealing with (front end)script generated web elements, then you must need to embrace lean way of thinking. Don't try to pull out a web element by it's property alone. If you are not getting them try to build a xpath from its parent or siblings.
say, the HTML goes like this,
<div id="somestatic id">
<div id="xyz">
<input name="dynamic one"/>
</div>
</div>
Then you can build a xpath as ,
//*[#id='staticID']/div/input
for the HTML,
<div id="staticID"></div>
<input name="dynamic one"/>
the xpath is ,
//*[#id='staticID']/following-sibling::input
similarly there are n number of option available. Give them a try
Try
driver.findElement(
By.cssSelector("input[id*='ext-gen']")
).getAttribute("placeholder")
Let me know is the above statement is working or not.
The best way is to find the element with CSS selector in this case -
input[placeholder='Gender'], which can easily find the element.

How do I hide a field given a checked box?

I am trying to create a dynamic query page. I am more than happy to learn ruby on rails which is what I am currently doing. However there is a time constraint for this and I have been searching high and low on how to hide a field on a form if a checkbox is checked. I have next to nothing ruby skills and I cant change to another language. Any assistance would be greatly GREATLY appreciated. Also if you know a good tutorial for doing query pages would help!!!
For a form like:
<form ...>
<input id="hide-box" type="checkbox" />
<input id="field-to-hide" />
</form>
You'll need to use something like JQuery to listen for checking and hide accordingly.
$('#hide-box').on('change', function() {
$('#field-to-hide').toggle($(this).prop('checked'));
});

joomla calendar function popup box

I am trying to get a calendar function to work:
<label id="jform_issuedate-lbl" class="hasTip" title="Issue date::" for="jform_issuedate">Issue date</label>
<input id="jform_issuedate" type="text" value="2013-09-25" name="jform[issuedate]" title="Wednesday, 25 September 2013">
<img id="jform_issuedate_img" class="calendar" alt="Calendar" src="/media/system/images/calendar.png">
However when I use it in the site there is no pop up and no error is thrown. It was working and now isn't. I'm sure I must be doing something stupid and help appreciated
I found the problem
I had this in before another bit of script and it seems it isn't compatible with the calendar function in joomla 2.5

Resources