What java code do I need create pricing forms on my web page alongside drop-down menus to easen selection and a field automating the item price total of the selected products?
Â
Â
Answered By
ammara
0 points
N/A
#148248
Ways to create pricing forms with drop-down and automatic summation with Java
Â
Java is an imperative, object-oriented, generic, reflective computer language designed mainly for application, web programming.Java code in an HTML page by using the special delimiter<% and %>. A JSP is compiled to a Java servlet, a Java application in its own right, the first time it is accessed. After that, the generated servlet creates the response
Ways to create pricing forms with drop-down and automatic summation with Java
Hello,
Adding drop-down menu and forms in your website won’t be a problem if you’re familiar with Java and JavaScript.
Â
They’re basically famous for creating GUIs and gadgets on your website to make it more dynamic and functional.
Â
For Java you can use the
power of Combo Boxes. Combo Box is one of the applications of Java programming.
Â
Here you can create a menu which allows the user to choose from several selections.
Â
The default here is uneditable form, but you can program it to make it editable if you want.
Â
The other kind of combo Box is the Custom renderer. This will display each item in its menu.
Â
If just want to display prices, I suggest that you use the uneditable combo box.
Â
Custom Renderer is good if your application includes graphics or images.
Â
Â
You can use JavaScript for your needs as well. It is much simpler than Java but it can be a little bit limited. The code below show an example of a JavaScript program for dropdown:
Â
SCRIPT LANGUAGE="javascript">
<!–
function OnChange(dropdown)
{
var myindex = dropdown.selectedIndex
var SelValue = dropdown.options[myindex].value
var baseURL = <Some value based on SelValue>
top.location.href = baseURL;
Â
return true;
}
//–>
</SCRIPT>
Â
Â
You need to insert this program in the HTML code of your Web page.
Â
Regards,
Taylor