Controlling tabbing in form inputs - html

is it possible to skip the url field when tab button is pressed in a form?
like after it goes to the last input element i wanted it to go back to the first input element instead of going to the url field!
thanks a alot.

You can add an onkeyup on your last input and check if the tab-key was pressed and then run something like your_first_input.focus(), so that it jumps to the first input.

Related

Finding input and button elements with sellinium

I'm able to enter this page here and click confirm cookies "Got it" button, click "play demo" button and click confirm age button to enter this page here (TOKEN CREATED FOR EACH DEMO FOR THIS LINK)
I'm also able to extract the value from the round count using this xpath here #class,'coefficient and also extract the finished round count value using this xpath here #class,'flew-coefficient
What I want to do next is to locate the input element and enter the value amount on the left hand side and click the big blue "bet" button on the left hand side but I can't seem to locate the value input "1.00" and the button on the left of the page. Please see my code and assist if you can.
To set the desired input value please try this:
String inputXpath = "//input[contains(#class,'roboto-font-b')]";
WebElement input = driver.findElement(By.xpath(inputXpath));
input.click();
input.sendKeys(Keys.chord(Keys.CONTROL,"a",Keys.DELETE));
input.sendKeys("20");
To click the Bet button please try this:
driver.findElement(By.xpath("//button[contains(#class,'success')]")).click();
Sorry to come back this late, I had some personal stuff to attend.
I managed to use the following xpath to find the input but only one text is deleted:
String inputXpathL = "//app-bet-control[#class='bet-control double-bet'] //div[#class='second row']//input[#class='roboto-font-b']"; WebElement inputTargetL = driver.findElement(By.xpath(inputXpathL)); inputTargetL.click(); inputTargetL.sendKeys(Keys.chord(Keys.CONTROL,"a",Keys.DELETE)); inputTargetL.sendKeys("10");
For the button I used the following xpath but the button is unclickable and there are no exceptions or errors:
findElement(By.xpath("//app-bet-control[#class='bet-control double-bet']//button[#class='btn btn-secondary btn-sm betopt ng-star-inserted']")).click();

Is there any way to override a mailto field with another field?

AKA, if I have two fields (one radio button group and one textarea that only appears if the "other" radio button is pressed) how would I make it so the input from the text area overrides the "other" button having it's value placed in the mailto?
E.g., I want this to happen:
field1=text from text area
NOT this:
field1=other
field2=text from text area
Could I set the value of the "other" radio button in field1 to the text coming from the text area?
Alternatively, could I do anything to prevent a certain field from appearing in the mailto fields?
In future, please ensure you present SO with a code issue, not a general question or request. However, you would use a JQuery change handler, like so:
$('#mastertextboxid').on('input', function(){ //executes every time master's text is updated
$('#slavetextboxid').value($('#mastertextboxid').text()); //updates the values
})
This will overwrite any text in the slave textbox when the master textbox is changed, but the User will still be able to input into the slave textbox. It's known as One way data binding.

Input Field with text already populated on page load

I have a custom Visual Force page that on load has a name field that is supposed to have {Auto} printed inside the input text box that the user can delete or leave or not. I have been using a html-placeholder however the text just disappears and is gray.
My VF inputfield:
<apex:inputfield required="true"
value="{!EventPackageRevenueBreakdown__c.Name}" html-placeholder="{!Auto}"></apex:inputfield>
What it looks like with that code:
What I need it to look like (notice the cursor is after the closing scope)
Thanks in advance I'm still very new to this!
I suggest you to set Name field in controller with '{Auto}' value.
The placeholder attribute will disappear when there is a value in the field, what you want is to actually set the VALUE of the field to {Auto}.
Try this:
If you want it to automatically clear the field if a user clicks into it, you could add some javascript to handle that.

Angularjs Form allows jump to next tab only if all fields of this tab is valid

There is a form created using Angularjs,created a next button that jumps to next tab but dont know how to put check so that it first check all inputs and then jump to next tab if all valid.
next button performs 2 functionalities:-
1.checks all inputs are valid and required.
2.After checking,jumps to next tab if all valid and completly filled.

MVC - override validation when one particular button is clicked

I have a table that lists items. I have a form tag that surrounds this table. In this table I have ADD buttons that adds new rows to the database. I have EDIT buttons that edits a row as well. The form posts to the same action on the controller.
Now I need to add a filter row on the first which means I need to add a Filter button to submit the form with the filter parameters. Since this is still inside the main form, I now have the following problem: When I click the Filter button, the inputs that are used for the ADD button are being validated before anything gets posted. How can I prevent the validation from occurring when the user clicks the Filter button?
Make sure the Filter button is of type "button" not "submit" and do filter using ajax
As i see it, the easy way would be to fire the submit via js with:
.submit();
The other way would be to disable validation on that form with this:
$('#form').validate({
onsubmit : false
});
or
$('#form').unbind('submit')
I have one suggestion. Name Add button inputs differently and add row using javascript/ajax. When posting, Add button inputs will not be validated because they have different names