Jump to content


  • Content Count

  • Joined

  • Last visited

Community Reputation

0 Neutral

About Lepper

  • Rank
  1. In the onclick event of the checkboxes (or in the onclick event of your button or submit button) you can call a javascript function that changes the href of the current page with the window.location.href = "http://the_page_you_want";An example is below:<script type="text/javascript">function goToPageDependingOnCheckedCheckBox(){ if(document.getElementById('check1').checked){ window.location.href = "/someDirectoryOfMyWebServer/page1.html"; } else { //if the checked checkbox is the other checkbox window.location.href = "/someDirectoryOfMyWebServer/page2.html"; }}</script> Note
  2. maybe this works:...onclick="window.open(window.location.href='var win = new Window({className: 'spread', title: 'Ruby on Rails',top:70, left:100, width:300, height:200,url: 'http://www.rubyonrails.org/', showEffectOptions: {duration:1.5}}); java script:win.show()')" style="cursor: pointer">... I'm not sure if this will work... but you can try :)Note: I think that there is a "}" that has no start "{"You must delete the last "}"
  3. it's absolutely necesary that all that "onclick" code be on the same line? I think that maybe is a quote problem (or that "java script" sentence maybe have to be "javascript")
  4. Hello!I need some help with detection of cookies. The problem regards to Internet Explorer. In mozilla I have no problem with the "navigator.cookiesEnabled", but in Internet Explorer always returns true, even if I deactivate in the the option "Tools -- Internet Options -- Privacy -- Advanced" checkboxes "Overwrite automatic cookies administration" and "Always accept session cookies".Maybe you don't understand me... but i need to detect if the browser can accept SESSION cookies from third parties... and the navigator.cookiesEnabled doesn't detect that. By default, internet explorer doesn't acce
  5. Sorry!! the correct way to access is document.forms[0].yourSelectBoxName.options[document.forms[0].yourSelectBoxName.selectedIndex].valueNote that "options" was added... I forgot to place it in my previos post... sorry.also... you can access a select element by the "document.getElementById(mySelectId)" function (if an id is defined for your select)please read this page with tutorials and properties of the select element
  6. I use the following but it doesn't work document.getElementById("myThing").style.background-color = "yellow"; However, this style property does work: document.getElementById("myThing").style.display = "block"; Am I accessing wrong the property background-color?Thanks!
  7. To access a value of a selected option in javascript you can use the following code in a javascript function that you define: //example that pop up a message with the value of the selected value in a select boxfunction alertSelectedValue(){alert(document.forms[0].yourSelectBoxName[document.forms[0].yourSelectBoxName.selectedIndex].value);} Hope this helps you in your algorythm
  8. The easiest way to open an image in a new window is to doing the following:<a href="/img/MyImage.jpg" target="_blank"><!-- the image to show... but littler--><img src="/img/MyImage.jpg" width="XX" height="XX"/></a ... yeah... this is not a javascript... but is the easiest way to open an image (called in this example "MyImage.jpg") in a new window (thanks to the "target="_blank"" atribute of the "a" tag).
  9. To show or hide some thing in your page use the property .style.display in the element you want to show/hide... for example: <script type="text/javascript">function showHide(id){var element = document.getElementById(id); try{ if(element.style.display == "none") {element.style.display = "";}} catch (e) { //do something if the id provided doesn-t obtain an element from your document}} PD: you can replace line <element.style.display = "";> with element.style.display = "block"; too
  10. THANK YOU VERY MUCH!!! Your answer was absolutely correct!! I thought that every getCodSomething() returns a String, but there was a method (.getCodEvaluacion()... the was not listed in your list ) that returns an int value... and there was the problem, because I used the method .equals in this primitive type! what a blasfemy!! Thank you very much jesh! I was confused because the error message that the compiler sends me, said that the problem was in "j" (the index of the "for" statement)... so... that teachs me that I cannot trust in the compiler messages :)Ah! this code is written in spanish
  11. First of all... sorry for posting here... but there is no section of Java language in this forum... but i know someone here can help me :)I got the error "int cannot be dereferenced" inside a for... this is the code <% if(dsc != null) { boolean pintO = false; for(int j = 0; j < dsc.length; j++){if(dsc[j].getDetalleEvaluacion().getContenidoGlobal().getCodContenido().equals(detalleEvaluacion.getContenidoGlobal().getCodContenido())&& dsc[j].getDetalleEvaluacion().getContenidoGlobal().getUnidadGlobal().getCodUnidad().equals(detalleEvaluacion.getContenidoGlobal().getUnidadGlobal(
  12. Lepper


    do you mean a different way of showing alerts boxes? (alerts like this? --> alert("My alert!")
  13. Lepper


    A great site is w3Schools. It have a lot of information an tutorials :)Also you can find an incredible amount of examples an "ready codes" searching with google.If you have a more specific question about some thing, you can post here and we will try to help you as soon as possible
  14. How to access elements in AjaxAnywhere zones with DOM?Hello! I have a problem accesing the elements that is inside an AA (ajaxAnywhere) zone in my JSPs with the DOM thing. Also, the data that is contained in that elements it is not submited to the action, so... I had to make some big javascripts to send that data (slected item from a select box, words writen in a text box, etc) to the action making some "not sense" to use ajaxAnywhere. In example, if I want to access some property for a select box in the form of my JSP I use the following code: document.forms[0].selectBoxName.options[index].
  • Create New...