How to check from client side?

Posted by Laghaterohan under Regular Expressions on 3/21/2011 | Points: 10 | Views : 1246 | Status : [Member] | Replies : 6
Hello,

I have a Result printing module in which i have a form in which i have a textbox in which the user enters a roll no of the student whose result is to be printed and clicks on print button.

Now, when the user clicks on the print button i will check thru my database if the result is already printed if the result is printed i will show a pop up to the user saying....This Result is already printed would u like to re print it..? And then 2 boxes Yes No...if the user clicks on Yes again print operation will be carrried out if the user clicks on No then the print operation is cancelled....

May i know how can i do this...? I guess we have to use call back...but i have not yet tried this please help me...do u have any simple method to achieve this??

Thanks!

Best Regards,
Rohan Laghate



Responses

Posted by: Laghaterohan on: 3/21/2011 [Member] Starter | Points: 25

Up
0
Down
ne help please....i want help....

Best Regards,
Rohan Laghate

Laghaterohan, if this helps please login to Mark As Answer. | Alert Moderator

Posted by: SheoNarayan on: 3/21/2011 [Administrator] HonoraryPlatinum | Points: 25

Up
0
Down
As this is a web application so I would suggest to retrieve the value of the record whether it has been printed or not as soon as the page loads (store this into the JavaScript variable like below (_documentPrinted is your variable that holds the boolean value from the database).

var IsPrinted = '<%= _documentPrinted %>';


On click of the Print button, call a JavaScript function that will check for the IsPrinted variable, if it is true then will fire the confirm method of JavaScript by passing the string "The result is already printed ....". If user clicks OK, it returns true and you will check for that value and fire the window.print() method.

if (IsPrinted)

{
var v = confirm('The result is already printed, do you ....');
if (v)
{
winow.print();
}
}


Hope this approach will give you some idea and you will be able to do this yourself.

Thanks

Regards,
Sheo Narayan
http://www.dotnetfunda.com

Laghaterohan, if this helps please login to Mark As Answer. | Alert Moderator

Posted by: Laghaterohan on: 3/21/2011 [Member] Starter | Points: 25

Up
0
Down
Thanks Sheo,

However i cannot retrieve the value of the record whether it has been printed or not as soon as the page loads because it will all depend on the Roll Number that i will be entering in the text box....:)

I am stuck..

Best Regards,
Rohan Laghate

Laghaterohan, if this helps please login to Mark As Answer. | Alert Moderator

Posted by: Madhu.b.rokkam on: 3/21/2011 [Member] [MVP] Bronze | Points: 25

Up
0
Down
Get the details of the record on textbox change from the databse and then you can follow the way as Sheo suggested.

Thanks and Regards
Madhu

Laghaterohan, if this helps please login to Mark As Answer. | Alert Moderator

Posted by: Laghaterohan on: 3/22/2011 [Member] Starter | Points: 25

Up
0
Down
How to access the value returned by the confirm box from code behind? I am badly stuck..please help me out....

Best Regards,
Rohan Laghate

Laghaterohan, if this helps please login to Mark As Answer. | Alert Moderator

Posted by: Laghaterohan on: 3/23/2011 [Member] Starter | Points: 25

Up
0
Down
I have temp solved the issue by using Modal Popup but i want solution for the above problem...
Please let me know...ne one please....

Any help?

Best Regards,
Rohan Laghate

Laghaterohan, if this helps please login to Mark As Answer. | Alert Moderator

Login to post response