|
Sorry to all because i have found code that when i was post this message
here is the answer
<br />
<script language=javascript><br />
var PreviewWnd = null;<br />
function Preview()<br />
{<br />
if (Submitted) return false;<br />
PreviewWnd = open("","preview","toolbar=no,resizable=yes,scrollbars=yes,directories=no,menubar=no,width=400,height=300");<br />
document.MessageForm.action = "onizleme.jsp";<br />
document.MessageForm.target = "preview";<br />
return true; <br />
}<br />
var Submitted = false;<br />
function Submit() <br />
{<br />
document.MessageForm.action = "gonder.jsp";<br />
document.MessageForm.target = "_top";<br />
Submitted = true;<br />
return true;<br />
}<br />
</script><br />
<br />
<br />
<br />
<form action="gonder.jsp" method=post name=MessageForm><br />
<br />
<!-- Add the data entry bits --><br />
Your Name <INPUT type="text" name=txb><br><br />
<br />
<!-- Add some buttons --><br />
<input class=formButton type=submit name=preview value=Preview onclick="return Preview();"><br />
<input class=formButton type=submit name=submit value="Post Message" onclick='return Submit();'><br />
<br />
<!-- close the form --><br />
</form><br />
<br />
|
|
|
|
|
Hello,
I have got a datagrid that I have databound an XML file as the data source, this view correctly and I am able to insert and edit/update/delete the entries as I wish.
I am looking to be able to custom sort the list, with the help of "move up/down arrows" on each row within their own columns in the grid; I am quite new to this and have had no luck with finding any examples.
Could any one point me in the right direction?
Thanks
Bart
|
|
|
|
|
Hi Every budy
I have to make my header location fix (it must not slide) while whole page can slide.
can any budy help me.
Thank you
shailendra
|
|
|
|
|
Using CSS 'position' property set to 'fixed' with a top and left property as well. Of course it won't work in IE6!
|
|
|
|
|
Hi all
Is exist an way to catch event when child window is closed???
I.e.
<br />
var childWin = null;<br />
<br />
function an_button_click()<br />
{<br />
childWin = window.open("anurl");<br />
<br />
childWin.on unload = child_onunload;
}<br />
<br />
function child_onunload()<br />
{<br />
alert("Child unload!!!");<br />
}<br />
<br />
And after all when childWin window is closed onunload() function will not invoke, although i had event handler on this. What i do wrong??
Or this is feature of child windows? How i can overcome this??
Thank
-- modified at 5:56 Wednesday 24th January, 2007
|
|
|
|
|
I am not a javascript guy still giving it a try...
<script language="Javascript">
var msg = "Bye";
function onuld()
{
alert(msg)
}
</script>
<body on unload="onuld()">
|
|
|
|
|
I want what eventhandler invoke in parent window. In you case one will invoke in child.
I.e.
ParentWindow
- contain an _gVal variable, which i want to change when child window
is closed
Actually my objective is pass an data from child window to parent, when one close.
Thank
|
|
|
|
|
It's easier to do that from the child window:
<body onunload=somefunction() >
...
function somefunction()
{
window.opener._gVal = desiredvalue;
}
|
|
|
|
|
Heh
If _gVal have class type, it still don't work.
I suppose what if "desiredvalue" belong to closed child window one will be destroyed when window close and beame invalid for parent window.
|
|
|
|
|
can i use "page setup" and "print preview" funtionalities of the browser using javascript?
how??
|
|
|
|
|
Short answer no, long answer yes.
Brad
Australian
- Christian Graus on "Best books for VBscript"
A big thick one, so you can whack yourself on the head with it.
|
|
|
|
|
|
From what I can remember there is no way to call it through javascript. Perhaps you would be able do it through ActiveX or Java or maybe if you created a javascript function that allowed you to reformat the page based o user input.
Brad
Australian
- Christian Graus on "Best books for VBscript"
A big thick one, so you can whack yourself on the head with it.
|
|
|
|
|
|
A lot of fine tuning and hard work.
Brad
Australian
- Christian Graus on "Best books for VBscript"
A big thick one, so you can whack yourself on the head with it.
|
|
|
|
|
Found the smiley's I see.
Brad
Australian
- Christian Graus on "Best books for VBscript"
A big thick one, so you can whack yourself on the head with it.
|
|
|
|
|
why dont u help me out in fine tuning it?
|
|
|
|
|
Sorry, what are you referring to as it?
Brad
Australian
- Christian Graus on "Best books for VBscript"
A big thick one, so you can whack yourself on the head with it.
|
|
|
|
|
|
I listed Active X as a possibility. The only problem with ti tis that it is only support by Internet Explorer. I would recommend googling the question and see what comes up.
I wonder though, why do you want to do this?
Brad
Australian
- Christian Graus on "Best books for VBscript"
A big thick one, so you can whack yourself on the head with it.
|
|
|
|
|
I am having a problem where I am sending XMLHTTPRequest in a for loop [function: updateStatus()] and only the last row in the loop's style attributes get updated on the page [function: StatusChange()], but each XMLHTTPRequest is making the correct change on the server. Is there a way to wait for each callback, change the style attributes and then go on to the next call? Any suggestions would be helpful.
Summary:
UpdateStatus()
|_calls StatusChange()
|_loadXMLDoc()
processReqChange()
|_call StatusChange() -> with a response to update nodes
<script language="javascript"><br />
var req;<br />
<br />
function loadXMLDoc(url) {<br />
req = false;<br />
if(window.XMLHttpRequest && !(window.ActiveXObject)) {<br />
try {<br />
req = new XMLHttpRequest();<br />
} catch(e) {<br />
req = false;<br />
}<br />
} else if(window.ActiveXObject) {<br />
try {<br />
req = new ActiveXObject('Msxml2.XMLHTTP');<br />
} catch(e) {<br />
try {<br />
req = new ActiveXObject('Microsoft.XMLHTTP');<br />
} catch(e) {<br />
req = false;<br />
}<br />
}<br />
}<br />
if(req) {<br />
req.open("GET", url, true);<br />
req.onreadystatechange = processReqChange;<br />
req.send("");<br />
}<br />
}<br />
<br />
function processReqChange() {<br />
if (req.readyState == 4) {<br />
if (req.status == 200) {<br />
response = req.responseXML.documentElement;<br />
method = response.getElementsByTagName('method')[0].firstChild.data;<br />
result = response.getElementsByTagName('result')[0].firstChild.data;<br />
status = response.getElementsByTagName('status')[0].firstChild.data;<br />
invoice = response.getElementsByTagName('invoice')[0].firstChild.data;<br />
eval(method + '(invoice, status, result)');<br />
} else {<br />
alert('There was a problem retrieving the XML data:\n ' + req.statusText);<br />
}<br />
}<br />
}<br />
<br />
function updateStatus(status) {<br />
var tblrows = document.getElementById('wtgridScreen_dgScreen').rows;<br />
if (tblrows != null) {<br />
for (i = 1; i < tblrows.length - 1; i++) {<br />
if(tblrows[i].cells[0].children[0].children[0].checked) {<br />
var sid = tblrows[i].cells[1].attributes['record_keys'].value;<br />
StatusChange(sid, status, '');<br />
}<br />
}<br />
}<br />
}<br />
<br />
function StatusChange(id, status, response) {<br />
if (response != '') {<br />
if (response == 'Success') {<br />
tblrows = document.getElementById('wtgridScreen_dgScreen').rows;<br />
if (tblrows != null) {<br />
for (i = 1; i < tblrows.length - 1; i++) {<br />
sid = tblrows[i].cells[1].attributes['record_keys'].value;<br />
if (sid == ('id=' + id)) {<br />
oRow = tblrows[i];<br />
oRow.style.backgroundColor = '#FFFFFF';<br />
oRow.cells[0].children[0].children[0].checked = false;<br />
}<br />
}<br />
}<br />
}<br />
} else {<br />
url = 'http://localhost/ptweb/custompages/_xmlInvoiceStatus.aspx';<br />
url += '?method=StatusChange&' + id + '&status=' + status + '&reason=';<br />
loadXMLDoc(url);<br />
}<br />
}<br />
</script>
|
|
|
|
|
You have specified that the request will be asynchronous:
req.open("GET", url, true);
Try changing the above "true" to "false".
|
|
|
|
|
Thank you for your response. I just tried your suggestion and now it will process the first request in the for loop and then stops.
|
|
|
|
|
I think that I will just build an xmldoc and send that to the asp page. This way, there will only be one XmlHTTPRequest sent per user click even if there are multiple items selected.
|
|
|
|
|