Reply to Assigning Hidden fields using Javascript

Your name:

Reply:


Posted by allanrodkin on 09/05/05 07:31

I am working on a Perl program which dynamically creates an HTML form
by appending data to the $html variable. In order for me to have the
write data to the database, I need to have Javascript set the values of
two hidden forms. The entire web page is contained in a form called
Allan.

Here are the hidden fields:
$html .= qq`<input type="hidden" name="SGROUP" value="">`;
$html .= qq`<input type="hidden" name="STYLE" value="">`;

Within the JavaScript I assign values to these hidden fields and then I
use alert check to test to see if their values have been assigned
correctly. Within the Javascript, their values are assinged correctly!
For example, I will explicitly show this

For example:
#Here is the javaScript function

function do_processForm()
{
var stopper;
var i;
var selectedSG;
var concat;
var styleSelect;
loopcounter = document.Allan.RADEO.value;
//alert('This is loopcounter ' + loopcounter);
for (i=0;i<loopcounter;i++){

if(document.Allan.SGGroup[i].checked){
selectedSG = document.Allan.SGGroup[i].value;
stopper = i;
}
}

//concat = "st"+stopper;
document.Allan.SGROUP.value = selectedSG;
alert('Checking for hidden field' +
document.Allan.SGROUP.value);
//The alert pop-up generated produces the correct result
//suggesting that hidden field "SGROUP" has been assigned the
//correct value
//Javascript continues.....
</script>

At the end of the Perl script, I print the HTML and all the
dynamic HTML has been generated, however SGROUP has "" value. Can
anyone make sense of this?

Thanks,
Allan

[Back to original message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация