Hi
I'm trying to submit data to a web form. On entering the data into a text form on the web page, the data is then displayed in a java pop up window, asking for confirmation to enter. The java pop up has 2 buttons: OK and Cancel. I need to somehow refernce the OK button and click it, but cant decipher the javascript - no button references that look like they may belong to the OK button in the code that I can see?? Anyway, some of what I believe is the relevant HTML code below - any ideas gratefully receved!!
cav
I'm trying to submit data to a web form. On entering the data into a text form on the web page, the data is then displayed in a java pop up window, asking for confirmation to enter. The java pop up has 2 buttons: OK and Cancel. I need to somehow refernce the OK button and click it, but cant decipher the javascript - no button references that look like they may belong to the OK button in the code that I can see?? Anyway, some of what I believe is the relevant HTML code below - any ideas gratefully receved!!
cav
Code:
</TD></TR></TABLE>
<script language='javascript'>
document.domain='advfn.com';
</script>
<script language='javascript'>
<!--
function doSubmit()
{
val = document.forms[0].btn.value;
add = document.forms[0].add.value;
mid = document.forms[0].mid.value;
if (val=="go"){
openDialog( 'http://www.advfn.com/p.php?pid=m_add&replace=1&add='+add+'&mid='+mid+'&cb=1134933464' , 'Add Stocks' , '450', '200'); }
}
var jsWindow = null;
function openDialog(url , title , width , height)
{
//center on current window
var x,y,w,h;
if(document.all)
{
x = window.screenLeft;
y = window.screenTop;
w = window.document.body.clientWidth;
h = window.document.body.clientHeight;
}
else
{
x = window.screenX;
y = window.screenY;
w = window.outerWidth;
h = window.outerHeight;
}
//alert( x+"," + y + ","+w +","+h);
x += Math.round( (w - width )/2 );
y += Math.round( (h - height )/2 );
//
/*
if(jsWindow!=null)
jsWindow.close();
*/
var temp = ( Math.round(Math.random() * 10000) ) .toString();
/**** this code does not work on all browsers
jsWindow=window.open("about:blank","mon"+temp+"1134933464","top="+y+",left="+x+",screenX="+x+",screenY="+y+",width="+ width +",height="+height+",resizable,scrollbars");
jsWindow.document.open();
jsWindow.document.write("<html><head><LINK rel='stylesheet' href='/style.css'></LINK><title>ADVFN.com--</title></head>"+
"<frameset rows='*,35' border='0'>"+
"<frame name='mtop' src='"+ url+"' scrolling='yes'>"+
"<frame name='mbot' src='/jsdialog.html' scrolling='no' noresize>"+
"</frameset></html>");
jsWindow.document.close();
*/
jsWindow = window.open("/p.php?pid=dialog_container&title=&url="+escape(url), "mon"+temp+"1134933464","top="+y+",left="+x+",screenX="+x+",screenY="+y+",width="+ width +",height="+height+",resizable,scrollbars");
jsWindow.focus();
}