<tr class="bg-row1">
<td class="td-highlighted-2">
<div align="left"><%=searchList1.getProjid()%></div>
</td>
<td class="td-highlighted-2">
<div align="left"><%=searchList1.getProjname()%></div>
</td>
</tr>
here jsp update request happens to be invoked by a link
in updateproject.jsp how can i refer projid and projname value in a text box
For this type of scenario POST is better suited,
Even if you want to stuck with GET , you can use javascript and use window.open() function for your purpose , and build URL dynamically reading fields
Related
Hello i have a problem... Suppose that i have a table whit two textBox and one button.. when i click the button i must read the value of a textBox and create a directory in a specific path and the directory must be named like the value that i read on the TextBox
I've tryed this code but it dosn't work :(
file = directory.php
<?php
$idCantiere = $_POST["idCantiere"];
$codiceCommessa = $_POST["codiceCommessa"];
echo("Registrazione avvenuta");
chdir("../inserimento");
opendir(".");
mkdir("../inserimento/prova/".$idCantiere);
?>
file prova.html
<table method="POST" action="directory.php">
<tr>
<td bgcolor="#B2E5FB">Cantiere</td>
<td colspan="11"> <input type="text" id="idCantiere"></td>
</tr>
<tr>
<td bgcolor="#B2E5FB">Codice Commessa</td>
<td colspan="11"> <input type="text" id="codiceCommessa"></td>
</tr>
<tr><td><button name="insAffidatario" type="submit" onclick="directory.php">Inserisci Affidatario</button></td></tr>
</table>
The problem with your code and it is a specific one; is that you used <table></table> for what should be a form, it should be <form></form>.
Then you used ID's instead of name attributes. You need to add name="idCantiere" and name="codiceCommessa" to their respective inputs.
You may also want to remove onclick="directory.php" here. The "action" already takes care of that.
Side note: Place your table inside the form and not outside. <form> cannot be made child of <table>.
Also make sure that the paths (and folders) correspond and that they are writeable with proper group/user permissions.
Error reporting will be of help also.
http://php.net/manual/en/function.error-reporting.php
and set to catch and display.
I have been added to project with ember. Unfortunetly I only know AngularJS. Anyway what I have to do is to add onclick event on checkbox. I've tried to use observer but without much success (probably because input is generated via iteration). Heres the code
{{#each prod in allProducts}}
<tr>
<td class="checkbox-event" selenium-id="check">{{input type=checkbox checked=prod.selected id=prod.id}}</td>
<td selenium-id="id">{{prod.productNumber}}</td>
<td selenium-id="name">{{prod.name}}</td>
<td selenium-id="category">{{prod.mainCategoryName}}</td>
<td selenium-id="price">{{prod.mainPrice}}</td>
</tr>
{{/each}}
What I need to do is to add click event on input that will call some function with prod as argument. I have only found answers for 'normal' input but not the one above.
You have several problems:
each prod in allProducts is wrong. Use {{#each allProducts as |prod|}}
type=checkbox is wrong. Use type="checkbox"
you can use change action.
Checkout this twiddle link
I have some HTML
<tr data-automation="registerRow" ng-repeat="item in vm.registers | orderBy : 'name'" class="ng-scope">
<td data-automation="register-name" class="ng-binding">Lane 1</td>
<td data-automation="register-status" class="center capitalize ng-binding">Uncounted</td>
<td><div class="btn-group" role="group"><button type="button" class="btn btn-action" ng-click="vm.count()">Count</button></div></td>
</tr>
I'm able to count the number of rows
casper.test.assertElementCount('[data-automation="register-row"]', 2);
I would like to check the text of the of [data-automation="register-name"].
Does Casper wrap jquery or anything where I could do ('selector').text()?
What Can I call in Casper to verify the [data-automation="register-name"] === "XXX"
there are two ways to achieve this:
Using the gethtml method, there is a really good example in the documentation:
http://docs.casperjs.org/en/latest/modules/casper.html#gethtml
Or you can inject your js script into the page with the evaluate method, your script will run in the context of the page. You can easily use jquery to fetch the text!! Here is the link to the docs: http://docs.casperjs.org/en/latest/modules/casper.html#evaluate
And for testing you can use assertEquals(testValue, expected)
I am really new to angular js, so this might be an easy solution for you guys.
I have two data sources, one from db and the second one from third party api. Inside ng-repeat , I am trying to replace one value of the current source with the second source if their id matches. I just want to show in the view and hence i dont need to update db.
<tr data-ng-repeat="affiliate in first_source">
<td>{{affiliate.affiliate_id}}</td>
<td>${{affiliate.payout | number:2}}</td>#I NEED TO REPLACE THIS VALUE FROM SECOND SOURCE if their id matches.
</tr>
**Origina Source example**
{affiliate_id:1,payout:2,type=test....}
**API SOURCE Example**
{affiliate_id:1,payout:5},{affiliate_id:2,payout:1}
Original outcome
<td>1</td>
<td>2</td>
<td>test</td>
Required Outcome
<td>1</td>#from original source
<td>5</td>#from second source
<td>test</td>#from original source
Any suggestion
As pointed out in the comments, you can do it using filters, directive, controller functions.
Below is one way to do it. This one does it in the template using ng-if directive.
<tbody>
<tr ng-repeat="affiliate in firstSource">
<td>{{affiliate.id}}</td>
<td ng-if="affiliate.id==secondSource[$index].id">{{secondSource[$index].payout}}</td>
<td ng-if="affiliate.id!=secondSource[$index].id">{{affiliate.payout}}</td>
<td>{{affiliate.type}}</td>
</tr>
</tbody>
You can preview working version here:
http://plnkr.co/edit/Fze7jcU5Nm3SKlgK4IIU?p=preview
If arrays can be in different order, it would be better to call a controller function. Demo as below:
http://plnkr.co/edit/1Jr1B3QL7NPX9nhMfH9x?p=preview
I have a Spring MVC application, use JSP+JQuery for view, and what I need is to, based on combo box selection (which gets me an index of element in list) to populate text field.
listProduct - list of products that is in the model
<form:form method="POST" commandName="productForm" name="insertRacun">
<table>
<tr>
<td class="ui-widget">Product:</td>
<td><form:select path="productListId" id="productCombobox">
<form:options items="${listProduct}"itemLabel="name" itemValue="productId"/>
</form:select>
</td>
<td class="ui-widget">Product price:</td>
<td><form:input path="priceList"
class="ui-widget ui-widget-content" id="priceInput" />
</td>
<script type="text/javascript">
var comboIndex = $("#productCombobox").val();
$("#priceInput").val(${listProduct[comboIndex].price})
});
</script>
My question is: When i put number in listProduct[] i.e. listProduct[0] it works just fine and price field gets populated, but when i want put "comboIndex" in brackets, it does nothing.
If there is another solution (not using JQuery), please post it
You are mixing client and server side code. You cannot pass a JS variable to your server code, as your server code is parsed before the page has been served up to the client.
You will need to pass the price corresponding to a particular product ID to the client by other means.
The relevant code (probably in a change event handler) should reference productCombobox selectedIndex instead:
var comboIndex = $("#productCombobox").attr("selectedIndex"); //
$("#priceInput").val(${listProduct[comboIndex].price});