staticText aus Formular mit javaScript auslesen

oh sorry, hab gemeint du wolltest den code meiner jsp!

hier der gewünschte code: alles wichtige ist dick markiert auch die statictext variablen.musst bissl scrollen um die zu sehen
Code:
<?xml version="1.0"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta content="no-cache" http-equiv="Pragma" />
<meta content="no-cache" http-equiv="Cache-Control" />
<meta content="no-store" http-equiv="Cache-Control" />
<meta content="max-age=0" http-equiv="Cache-Control" />
<meta content="1" http-equiv="Expires" />
<title></title>
<script type="text/javascript" src="/fips/theme/com/sun/rave/web/ui/veritastheme/javascript/formElements.js"></script>
<link rel="stylesheet" type="text/css" href="/fips/theme/com/sun/rave/web/ui/veritastheme/css/css_master.css" />
<link rel="stylesheet" type="text/css" href="/fips/theme/com/sun/rave/web/ui/veritastheme/css/css_ie55up.css" />

<script type="text/javascript">
var sjwuic_ScrollCookie = new sjwuic_ScrollCookie('/partner/generateReport.jsp', '/fips/faces/partner/generateReport.jsp'); 
</script>
<link id="link1" rel="stylesheet" type="text/css" href="/fips/resources/stylesheet.css" />
</head>
<script>
function NaviFenster () {
document.getElementById('form1:imageHyperlink1').click();
document.getElementById('form1:imageHyperlink3').click();
document.getElementById('form1:imageHyperlink2').click();
                }</script><body id="body1" style="-rave-layout: grid" onload="NaviFenster(); return body1_jsObject.setInitialFocus();" onunload="return body1_jsObject.setScrollPosition();">
<form id="form1" class="form" method="post" action="/fips/faces/partner/generateReport.jsp" enctype="application/x-www-form-urlencoded">
<div style="left: 0px; top: 0px; position: absolute; width: 140px"><div style="height:575px; width: 140px; -rave-layout: grid"><script>
                
function highlightRow(aRowNumber) {
	document.getElementById("form1:navi_left:table1:tableRowGroup1:" + aRowNumber + ":tableColumn1").style.background='#E7E7E7';

        return true;
}
                        
function clearRow(aRowNumber) {
        document.getElementById("form1:navi_left:table1:tableRowGroup1:" + aRowNumber + ":tableColumn1").style.background='WHITE';

        return true;
}                 
                
/* ----- Functions for Table Preferences Panel ----- */
/*
 * Toggle the table preferences panel open or closed
 */
function togglePreferencesPanel() {
  var table = document.getElementById("form1:table1");
  table.toggleTblePreferencesPanel();
}
/* ----- Functions for Filter Panel ----- */
/*
 * Return true if the filter menu has actually changed,
 * so the corresponding event should be allowed to continue.
 */
function filterMenuChanged() {
  var table = document.getElementById("form1:table1");
  return table.filterMenuChanged();
}
/*
 * Toggle the custom filter panel (if any) open or closed.
 */
function toggleFilterPanel() {
  var table = document.getElementById("form1:table1");
  return table.toggleTableFilterPanel();
}
/* ----- Functions for Table Actions ----- */
/*
 * Initialize all rows of the table when the state
 * of selected rows changes.
 */
function initAllRows() {
  var table = document.getElementById("form1:table1");
  table.initAllRows();
}
/*
 * Set the selected state for the given row groups
 * displayed in the table.  This functionality requires
 * the 'selectId' of the tableColumn to be set.
 *
 * @param rowGroupId HTML element id of the tableRowGroup component
 * @param selected Flag indicating whether components should be selected
 */
function selectGroupRows(rowGroupId, selected) {
  var table = document.getElementById("form1:table1");
  table.selectGroupRows(rowGroupId, selected);
}
/*
 * Disable all table actions if no rows have been selected.
 */
function disableActions() {
  // Determine whether any rows are currently selected
  var table = document.getElementById("form1:table1");
  var disabled = (table.getAllSelectedRowsCount() > 0) ? false : true;
  // Set disabled state for top actions
  document.getElementById("form1:table1:tableActionsTop:deleteTop").setDisabled(disabled);
  // Set disabled state for bottom actions
  document.getElementById("form1:table1:tableActionsBottom:deleteBottom").setDisabled(disabled);
}</script><div id="form1:navi_left:layoutPanel2" class="navibg" style=" height: 814px; left: 0px; top: 0px; position: absolute; width: 140px; -rave-layout: grid" style="position: relative;-rave-layout: grid;  height: 814px; left: 0px; top: 0px; position: absolute; width: 140px; -rave-layout: grid"><img id="form1:navi_left:image1" style="left: 0px; top: 0px; position: absolute" src="/fips/pics/top.jpg" alt="" border="0" />

<table id="form1:navi_left:table1" style="left: 0px; top: 150px; position: absolute; width: 177px;width: 140px" class="Tbl" border="0" cellpadding="0" cellspacing="0">
<tr id="form1:navi_left:table1:tableRowGroup1:0" onmouseout="clearRow(0);" onmouseover="highlightRow(0);">
<td id="form1:navi_left:table1:tableRowGroup1:0:tableColumn1" class="TblTdLyt" align="left" width="177"><a id="form1:navi_left:table1:tableRowGroup1:0:tableColumn1:hyperlink1" style="font-size: 11px" onclick="highlightRow(0);return hyperlink_submit(this, 'form1', null);" href="#">Start</a></td></tr>
<tr id="form1:navi_left:table1:tableRowGroup1:1" onmouseout="clearRow(1);" onmouseover="highlightRow(1);">
<td id="form1:navi_left:table1:tableRowGroup1:1:tableColumn1" class="TblTdLyt" align="left" width="177"><a id="form1:navi_left:table1:tableRowGroup1:1:tableColumn1:hyperlink1" style="font-size: 11px" onclick="highlightRow(1);return hyperlink_submit(this, 'form1', null);" href="#">Fonds</a></td></tr>
<tr id="form1:navi_left:table1:tableRowGroup1:2" onmouseout="clearRow(2);" onmouseover="highlightRow(2);">
<td id="form1:navi_left:table1:tableRowGroup1:2:tableColumn1" class="TblTdLyt" align="left" width="177"><a id="form1:navi_left:table1:tableRowGroup1:2:tableColumn1:hyperlink1" style="font-size: 11px" onclick="highlightRow(2);return hyperlink_submit(this, 'form1', null);" href="#">Formulare</a></td></tr>
<tr id="form1:navi_left:table1:tableRowGroup1:3" onmouseout="clearRow(3);" onmouseover="highlightRow(3);">
<td id="form1:navi_left:table1:tableRowGroup1:3:tableColumn1" class="TblTdLyt" align="left" width="177"><a id="form1:navi_left:table1:tableRowGroup1:3:tableColumn1:hyperlink1" style="font-size: 11px" onclick="highlightRow(3);return hyperlink_submit(this, 'form1', null);" href="#">Einmalanlage</a></td></tr>
<tr id="form1:navi_left:table1:tableRowGroup1:4" onmouseout="clearRow(4);" onmouseover="highlightRow(4);">
<td id="form1:navi_left:table1:tableRowGroup1:4:tableColumn1" class="TblTdLyt" align="left" width="177"><a id="form1:navi_left:table1:tableRowGroup1:4:tableColumn1:hyperlink1" style="font-size: 11px" onclick="highlightRow(4);return hyperlink_submit(this, 'form1', null);" href="#">Abgeltungssteuer</a></td></tr>
<tr id="form1:navi_left:table1:tableRowGroup1:5" onmouseout="clearRow(5);" onmouseover="highlightRow(5);">
<td id="form1:navi_left:table1:tableRowGroup1:5:tableColumn1" class="TblTdLyt" align="left" width="177"><a id="form1:navi_left:table1:tableRowGroup1:5:tableColumn1:hyperlink1" style="font-size: 11px" onclick="highlightRow(5);return hyperlink_submit(this, 'form1', null);" href="#">Sparplan</a></td></tr>
<tr id="form1:navi_left:table1:tableRowGroup1:6" onmouseout="clearRow(6);" onmouseover="highlightRow(6);">
<td id="form1:navi_left:table1:tableRowGroup1:6:tableColumn1" class="TblTdLyt" align="left" width="177"><a id="form1:navi_left:table1:tableRowGroup1:6:tableColumn1:hyperlink1" style="font-size: 11px" onclick="highlightRow(6);return hyperlink_submit(this, 'form1', null);" href="#">Entnahmeplan</a></td></tr>
<tr id="form1:navi_left:table1:tableRowGroup1:7" onmouseout="clearRow(7);" onmouseover="highlightRow(7);">
<td id="form1:navi_left:table1:tableRowGroup1:7:tableColumn1" class="TblTdLyt" align="left" width="177"><a id="form1:navi_left:table1:tableRowGroup1:7:tableColumn1:hyperlink1" style="font-size: 11px" onclick="highlightRow(7);return hyperlink_submit(this, 'form1', null);" href="#">Sparziel</a></td></tr>
<tr id="form1:navi_left:table1:tableRowGroup1:8" onmouseout="clearRow(8);" onmouseover="highlightRow(8);">
<td id="form1:navi_left:table1:tableRowGroup1:8:tableColumn1" class="TblTdLyt" align="left" width="177"><a id="form1:navi_left:table1:tableRowGroup1:8:tableColumn1:hyperlink1" style="font-size: 11px" onclick="highlightRow(8);return hyperlink_submit(this, 'form1', null);" href="#">VL</a></td></tr>
<tr id="form1:navi_left:table1:tableRowGroup1:9" onmouseout="clearRow(9);" onmouseover="highlightRow(9);">
<td id="form1:navi_left:table1:tableRowGroup1:9:tableColumn1" class="TblTdLyt" align="left" width="177"><a id="form1:navi_left:table1:tableRowGroup1:9:tableColumn1:hyperlink1" style="font-size: 11px" onclick="highlightRow(9);return hyperlink_submit(this, 'form1', null);" href="#">Einstellungen</a></td></tr></table>
<script type="text/javascript" src="/fips/theme/com/sun/rave/web/ui/veritastheme/javascript/table.js"></script>
<script type="text/javascript">sjwuic_table_assignFunctions('form1:navi_left:table1')</script>
<script type="text/javascript">sjwuic_table_assignPanelProperties('form1:navi_left:table1',new Array('form1:navi_left:table1:_embeddedPanels:_sortPanel','form1:navi_left:table1:_embeddedPanels:_preferencesPanel','form1:navi_left:table1:_embeddedPanels:_filterPanel'),new Array('form1:navi_left:table1:_embeddedPanels:_primarySortColumnMenu',null,null),new Array('form1:navi_left:table1:_tableActionsTop:_sortPanelToggleButton','form1:navi_left:table1:_tableActionsTop:_preferencesPanelToggleButton',''),new Array('/fips/theme/com/sun/rave/web/ui/veritastheme/images/table/sort_panel_flip.gif','/fips/theme/com/sun/rave/web/ui/veritastheme/images/table/preferences_panel_flip.gif', null),new Array('/fips/theme/com/sun/rave/web/ui/veritastheme/images/table/sort_panel.gif','/fips/theme/com/sun/rave/web/ui/veritastheme/images/table/preferences_panel.gif', null))</script>
<script type="text/javascript">sjwuic_table_assignFilterProperties('form1:navi_left:table1','MnuJmp','TblCstFltMnu','_customFilter','_customFilterApplied')</script>
<script type="text/javascript">sjwuic_table_assignSortPanelProperties('form1:navi_left:table1',new Array('form1:navi_left:table1:_embeddedPanels:_primarySortColumnMenu','form1:navi_left:table1:_embeddedPanels:_secondarySortColumnMenu','form1:navi_left:table1:_embeddedPanels:_tertiarySortColumnMenu'),new Array('form1:navi_left:table1:_embeddedPanels:_primarySortOrderMenu','form1:navi_left:table1:_embeddedPanels:_secondarySortOrderMenu','form1:navi_left:table1:_embeddedPanels:_tertiarySortOrderMenu'),new Array('Ascending','Ascending (A Before Z, 0 Before 9)'),new Array('Descending','Descending (Z Before A, 9 Before 0)'),'Duplicate Sort Columns Selected. Each sort column you select must be unique.','Missing Sort Column. Select all sort columns that precede the final one.','null',false,false)</script>
<script type="text/javascript">sjwuic_table_assignGroupProperties('form1:navi_left:table1','TblSelRow',new Array(''),new Array('form1:navi_left:table1:tableRowGroup1'),new Array(new Array('0','1','2','3','4','5','6','7','8','9')),new Array('0'),'Selections Not Displayed: {0}','\nTotal Selections: {0}','\n\nDelete all selections?\nThis cannot be undone.')</script>
<script type="text/javascript">sjwuic_table_assignGroupPanelProperties('form1:navi_left:table1','_columnFooterBar','_columnHeaderBar','_tableColumnFooterBar','_groupFooterBar','_groupHeader:_groupPanelToggleButton','Collapse Group','Expand Group','/fips/theme/com/sun/rave/web/ui/veritastheme/images/table/grouprow_expanded.gif','/fips/theme/com/sun/rave/web/ui/veritastheme/images/table/grouprow_collapsed.gif','_groupHeader:_warningIcon','/fips/theme/com/sun/rave/web/ui/veritastheme/images/other/dot.gif','/fips/theme/com/sun/rave/web/ui/veritastheme/images/alerts/warning_small.gif',null,'Group contains hidden selections','_groupHeader:_collapsedHiddenField','_groupHeader:_selectMultipleToggleButton','Select All','Deselect All')</script></div><script id="form1:script1" type="text/javascript"></script>
</div></div><div style="left: 140px; top: 0px; position: absolute"><div style="height: 70px; width:885px; -rave-layout: grid"><div id="form1:top:layoutPanel1" class="topbg" style="height: 70px; left: 0px; top: 0px; position: absolute; width: 880px; -rave-layout: grid" style="position: relative;-rave-layout: grid; height: 70px; left: 0px; top: 0px; position: absolute; width: 880px; -rave-layout: grid"><a id="form1:top:hyperlink1" class="toplk" style="left: 485px; top: 50px; position: absolute" onclick="return hyperlink_submit(this, 'form1', null);" href="#">Unternehmen</a><a id="form1:top:hyperlinkimpressum" class="toplk" style="left: 575px; top: 50px; position: absolute" onclick="return hyperlink_submit(this, 'form1', null);" href="#">Impressum</a><a id="form1:top:hyperlinkhinweise" class="top1lk" style="left: 653px; top: 50px; position: absolute" onclick="return hyperlink_submit(this, 'form1', null);" href="#">Rechtl. Hinweise</a><div id="form1:top:layoutPanel2" style="background-color: rgb(206, 0, 0); height: 70px; right: 0px; top: 0px; position: absolute; width: 130px" style="position: relative;-rave-layout: grid; background-color: rgb(206, 0, 0); height: 70px; right: 0px; top: 0px; position: absolute; width: 130px"></div><img id="form1:top:image1" style="left: 31px; top: 0px; position: absolute" src="/fips/pics/VSG_Logo.gif" alt="" border="0" /></div></div></div><div id="form1:layoutPanel1" class="panel_calc" style="height: 66px; left: 192px; top: 99px; position: absolute; width: 638px; -rave-layout: grid" style="position: relative;-rave-layout: grid; height: 66px; left: 192px; top: 99px; position: absolute; width: 638px; -rave-layout: grid"><span id="form1:label2" class="LblLev2Txt" style="left: 30px; top: 31px; position: absolute">
Die Druckst&uuml;cke wurden generiert! 
</span></div><span id="form1:label1" class="h1 LblLev2Txt" style="left: 190px; top: 78px; position: absolute; width: 251px">
Druckst&uuml;cke generieren 
</span><a id="form1:imageHyperlink2" style="left: 576px; top: 216px; position: absolute" href="/fips/faces/partner/Preisverzeichnis.jsp?docID2=1" target="_blank">&nbsp;preis</a><a id="form1:imageHyperlink3" style="left: 672px; top: 216px; position: absolute" href="/fips/faces/partner/imagebrochuere.jsp?docID=2" target="_blank">&nbsp;image</a><a id="form1:imageHyperlink1" style="left: 408px; top: 216px; position: absolute" href="/fips/faces/partner/pdf.jsp?docID3=1" target="_blank">&nbsp;Image Hyperlink</a><input id="form1:button1" name="form1:button1" class="speichern Btn2Mni" onblur="return this.myonblur();" onfocus="return this.myonfocus();" onmouseout="return this.myonmouseout();" onmouseover="return this.myonmouseover();" tabindex="15" style="left: 192px; top: 181px; position: absolute" type="submit" value="zur&uuml;ck"></input><script type="text/javascript">sjwuic_assign_button('form1:button1', defaultButtonStrings, true, true, false);</script><span id="form1:staticText1" style="left: 240px; top: 216px; position: absolute; width: 96px">true</span><span id="form1:staticText2" style="position: absolute; left: 240px; top: 240px">true</span>
<input id="form1_hidden" name="form1_hidden" value="form1_hidden" type="hidden" />

</form>

<script type="text/javascript">
var body1_jsObject = new Body('form1:button1');
</script>
</body>
</html>
 
Zuletzt bearbeitet:
Das hilft doch gleich mehr als alles bisher Geschriebene :)

Das, was du dort suchst, ist keine Variable, sondern ein Textknoten, wenn du wissen willst, musst du die data-Eigenschaft dieses Textknotens abfragen:
Code:
var imagebrochuere = document.getElementById('form1:staticText2').firstChild.data;
 
Wow, ich kann nicht mehr :-( nichts geht mehr,...
bin am ende meiner Geduld und wahrscheinlich auch am Ende deiner Geldung *sorry*

doch habe jetzt einfach dieses Beispiel versucht, ohne irgendeinen Textknoten oder so:

Code:
function NaviFenster () {
document.getElementById('form1:imageHyperlink1').click();
var preisverzeichnis = "false";
var imagebrochuere = "true";
if (imageborchuere == 'true')
{
document.getElementById('form1:imageHyperlink3').click();
}
if (preisverzeichnis == 'true')
{
document.getElementById('form1:imageHyperlink2').click();
}

und nciht mal das funktioniert! ich glaube ich habe noch einen Fehler im Code...Wollte damit erreichen das sich 2 der 3 Fenster öffnen. Doch anscheinend funktionieren nicht mal meine IF-Statements, denn es öffnet sich nur das erste.. :-(
 
MannoMeter, habs gerade entdeckt! aber jetzt gehts auch mit deinem Beispiel! er erkennt die Variable, könnte weinen vor Freude! echt *G*
Muss schon sagen vielen vielen DANK

danke euch beiden, die mir geholfen habt! vor allem *sven Mintel*
--> was arbeitest du'? weil du zeit hattest mir immer wieder zu helfen *G* find ich Stark...
 
Einen Wermutstropfen gibt es dennoch.

Die Methode click() kann nur im IE auf Links angewendet werden...in anderen Browsern funktioniert sie nur bei echten Buttons :-)
 
und andere Methode gibts nicht für Hyperlinks, denn ich verwende einen Delphi Browser, selbst entwickelt! dann bringt mir ja das alles nichts odeR?
 
Wenn du dir einen eigenen Browser programmiert hast, dann bring es ihm doch einfach bei :)

Ansonsten gibt es schon noch Wege, einen Klick dort auch in anderen Browsern zu simulieren.

Das Hauptproblem sehe ich eher in einer anderen Sache: dieser simulierte Klick soll ein Popup öffnen....Popupblocker sind schlau und merken, dass der Klick nicht vom Benutzer stammt...und blocken das ganz einfach.

Das wahre Problem ist also das neue Fenster und nicht das Klicken.
 
Zurück