File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
Win a copy of Clojure in Action this week in the Clojure forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Problem with a Form

 
Miguel Flecha
Ranch Hand
Posts: 85
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi all. I'm using this Javascript code to move elementes among 2 tables.
The problem is that I want to submit the content of the second table, which is an array, but when I get the content of the form that field is null.
What am I doing wrong? This is the code...


<script language="JavaScript">
var proyecto;
var truncado=0;
function openWindow() {
var url = "/defaultroot/buscarproyecto.do";
window.open(url,'buscar_proyecto','width=400,height=400,top=134,left=262,resizable=1,scrollbars=1');
}
function actualizar(){
proyecto=notificar.projectId.value;
var url="/defaultroot/prenotificar.do?projectId="+proyecto;
window.navigate(url);
}
function codigoSeleccionado(codigo){
if(codigo!=""){
if(document.notificar.projectId.options[0]!=""){
truncado=1;
}

if(truncado==0){var opciones=document.notificar.projectId.options;
document.notificar.projectId.options[0].text=codigo;
document.notificar.projectId.options[0].value=codigo;
for (i = 1; i < opciones.length ; i++){
if ((opciones[i].value==codigo)&&(i!= (opciones.length-1))){
for (j = i;j<opciones.length;j++){document.notificar.projectId.options[j]=opciones[j+1];
truncado=1;
}
break;
}
}
document.notificar.projectId.options[opciones.length-1]=null;
document.notificar.projectId.options.length--;
}else{
var opcion=document.notificar.projectId.options[0];
var opciones=document.notificar.projectId.options;
document.notificar.projectId.options[0].text=codigo;
document.notificar.projectId.options[0].value=codigo;
for (i = 1; i < opciones.length ; i++){
if(opciones[i].value==codigo){
document.notificar.projectId.options[i]=opcion;
break;
}
}
}
}
}

</script>

Thanks!

[ Tried to add code tags but it made it look worse - Eric ]
[ August 25, 2004: Message edited by: Eric Pascarello ]
 
Eric Pascarello
author
Rancher
Posts: 15385
6
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by Miguel Flecha:
Hi all. I'm using this Javascript code to move elementes among 2 tables.
The problem is that I want to submit the content of the second table, which is an array, but when I get the content of the form that field is null.
What am I doing wrong? This is the code...


First off When you say second table not submitting, I am assuming that the second table contains form elements that are being submitted. Second, is the second table within the form tags, if it is not, the elements are not included.

I am not sure what that code has to do with the submission problem. If that last part of the code that is not included in a function is not running, then you need to mkae that a function and call it onload.

Eric
 
Miguel Flecha
Ranch Hand
Posts: 85
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
the second table is in the form and within form tags
so it is not a problem of javascript??
 
Eric Pascarello
author
Rancher
Posts: 15385
6
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Is it just a table or does the table contain form elements??
 
Miguel Flecha
Ranch Hand
Posts: 85
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
it is a table with form elements, and one of them is an array containing the information that is not submitting correctly
 
Eric Pascarello
author
Rancher
Posts: 15385
6
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Before I look into the code, is the array in the form element correctly before the page is being submitted?

If the element is hidden then you can view it by typing

javascript:alert(document.formName.elementName.value)

into the address bar
 
Miguel Flecha
Ranch Hand
Posts: 85
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
yes. it's ok
 
I agree. Here's the link: http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic