Help!! Thank you!!!
Halo, i am doing a JSP program with Java script. Here i am facing some problems to passing the value for checking purposes.
Basically, i want to retrieve value from database and pass to JS function to check whether have any "empty value" or not. If got "empty value" then will call user to enter any value to that fields.
Here is my coding...
notes:
1. the value show using <input type="text field" is correct.
2. i am using for loop in the JS function for checking if more than 1 record..
JSP Program
String sql_query3 = "SELECT mry_fr_dte,mry_to_dte,mry_bud_qty,mry_bud_amt,mry_rate "+
" FROM mrbudf "+
" WHERE mry_item_num= '"+itemcode+"' "+
"GROUP BY mry_fr_dte,mry_to_dte "+
"ORDER BY mry_fr_dte ";
try {
getAllDetail2=db.execSQL(sql_query3);
catch(Exception e){
System.out.println("Error :"+e);
while(getAllDetail2.next()){
mry_fr_dte=getAllDetail2.getDate("mry_fr_dte");
mry_to_dte=getAllDetail2.getDate("mry_to_dte");
String mry_bud_qty =getAllDetail2.getString("mry_bud_qty");
String mry_bud_amt =getAllDetail2.getString("mry_bud_amt");
String mry_rate =getAllDetail2.getString("mry_rate");
//String date_mry_fr_dte =datefromat.format(mry_fr_dte);
// String date_mry_to_dte =datefromat.format(mry_to_dte);
%>
<tbody>
<tr>
<td width = "3%" align = "center"> <%=i%></td>
<td align="center" width = "17%">
<input type="text" name="txtfromdate<%=i%>" value="<%=datefromat.format(mry_fr_dte)%>" maxlength = "10" style="width:100%;text-align:center;" >
<input type="hidden" name="temp_txtfromdate<%=i%>" value="<%=datefromat.format(mry_fr_dte)%>">
</td>
<td align="center" width = "13%">
<input type="text" name="txttodate<%=i%>" value="<%=datefromat.format(mry_to_dte)%>" maxlength = "10" style="width:100%;text-align:center;" >
<input type="hidden" name="temp_txttodate<%=i%>" value="<%=datefromat.format(mry_to_dte)%>">
</td>
<td align="center" width = "15%">
<input type="text" name="rate<%=i%>" value="<%=mry_rate%>" style="width:100%;text-align:right;" >
<input type="hidden" name="temp_rate<%=i%>" value="<%=mry_rate%>">
</td>
<td align="center" width = "15%">
<input type="text" name="quantity<%=i%>" value="<%=mry_bud_qty%>" style="width:100%;text-align:right;" >
<input type="hidden" name="temp_quantity<%=i%>" value="<%=mry_bud_qty%>">
</td>
<td width = "15%" align ="center">
<input type="text" name="amount<%=i%>" value= "<%=mry_bud_amt%>" style="width:100%;text-align:right;" >
<input type="hidden" name="temp_amount<%=i%>" value="<%=mry_bud_amt%>">
</td>
</tr>
</tbody>
<%i++;
}//end while(getAllDetail2.next()
<input type="hidden" name ="curTotalRec" value="<%=i%>">
JS function ( when i call confirmation
function confirmationEdit(curTotalRec){
window.event.returnValue=false;
var countNull =1;
var total=curTotalRec;
var total_rec=parseInt(eval("document.all.curTotalRec").value);// total retrieved records
//document.writeln("value:"+total_rec);
for(var i=1;i<=total_rec;i++){
document.writeln("txtfromdate :"+eval("document.mrbudf.txtfromdate"+i).value);
document.writeln("txttodate :"+eval("document.mrbudf.txttodate"+i).value);
document.writeln("rate :"+eval("document.mrbudf.rate"+i).value);
document.writeln("quantity :"+eval("document.mrbudf.quantity"+i).value);
document.writeln("amount :"+eval("document.mrbudf.amount"+i).value);A prompt reply will be appreciate.... thank you very much.......
.@_ is right, you provide too little detail to answer your question... like what is the problem.
So for a general answer:
1) Try to avoid client side (javascript) validation. It will fail if the user turns off javascript of decides to maliciously fool the system (by inserting his own javascript calls)
2) Try to keep sql out of JSP. JSP is for display only. You should try to move the SQL into an external object that handles the query for you. Let this external class do the database queries, fill in a collection of data which you then send to the JSP. Best would be to use a servlet to access this data access object, so the JSP just knows about some basic java collection in the request scope (or some other scope). For more information do a search for MVC pattern (Model View Controller).
Similar Messages
-
hello, I'm using the same apple id on my Ipad and Iphone, and anything i do and my ipad reflects on my iphone. if i download an app on my iphone it also downloads on my ipad. Can i stop this from happening. i need help. thank you.
Yes, under the Settings for the store, you can turn off the auto download for purchases, that way if you purchase an app on another device it will not automatically download on that device. You would need to do this on both your iPad and iPhone.
-
Hi, I'm unable to use my speaker when I'm using Mac OS, which means I'm unable to unmute, decrease or increase the volume. However, I'm able to do so for Windows 7 OS on Bootcamp. Can anyone please advise on how to rectify this problem? I would greatly appreciate your help, thank you.
Hi Zac, sorry to hear about your troubles, but that's why us other users are here to try to help in these instances.
Open Console in Utilities & see if there are any clues or repeating messages when this connection drop happens. -
Dear Sirs,
I had just upgraded my OS to the OS X Mavericks. After doing so, I noticed the following changes:
1) My MS Outlook for Mac 2011 does not sync with my Mac book's calendar/contacts/notes.
2) My iPhone4s does not sync with my Mac book's calendar/contacts/notes anymore.
Please help, thank you.
aawwiiCorrect, USB local sync was taken away from iphones and ipads with 10.9.1 and 2. We are not allowed to speculate on rumours it might come back in 10.9.3 plus new iTunes. Either wait and see or explore Syncmate 5 beta free trial.
icloud still works.
Cant help with the Outlook problem. -
HT5312 I do not remember the security answer apple ID.Please help.Thanks you!
I do not remember the security answer apple ID.Please help.Thanks you!
If you have a rescue email address (which is not the same thing as an alternate email address) set up on your account then steps 1 to 5 on the page that you posted from should let you reset them : go to https://appleid.apple.com/ and click 'Manage your Apple ID' on the right-hand side of that page and log into your account, then click on 'Password and Security' on the left-hand side of that page and on the right-hand side you should see an option to send security question reset info to your rescue email address.
If you don't have a rescue email address (you won't be able to add one until you can answer 2 of your questions) then you will need to contact iTunes Support / Apple to get the questions reset.
Contacting Apple about account security : http://support.apple.com/kb/HT5699
When they've been reset (and if you don't already have a rescue email address) you can then use the steps half-way down the page that you posted from to add a rescue email address for potential future use -
Dear Iphone fans,
Recently, somehow I can't hear sounds when talking on my iphone4 either when calling or being called. When asking them later, they said they can hear me but my sound become very low and unclear. And I can't hear a thing at that time. Could anyone tell me how I could fix the problem.
I've bought this one for half a year. I need your help~
Thank you in advance.Dear Iphone fans,
Recently, somehow I can't hear sounds when talking on my iphone4 either when calling or being called. When asking them later, they said they can hear me but my sound become very low and unclear. And I can't hear a thing at that time. Could anyone tell me how I could fix the problem.
I've bought this one for half a year. I need your help~
Thank you in advance. -
hi, my new device was set up in the store that I bought it from. How can I transfer all old text messages over to my new device? I have followed the icloud back up steps on this page. Please help, thank you.
Its an iPhone 4
Message was edited by: zzziggy85Here is how
http://support.apple.com/kb/HT2109 -
TS2446 Hi,My Apple ID has been disabled Please help Thank you
Hi,My Apple ID has been disabled Please help Thank you Thank you Thank you Thank you Thank you Thank you Thank you Thank you
If changing your password does not solve then contact itunes support
-
As I was installing the Windows 7 on my Imacwith the bootcamp and stated how I wanted to divide the drive I put 160, but I want to add more space because of the adobe software it will not install two of them, so how can I add more on the drive space to from 160 to 250? please help thank you.
I'm not sure this is what you're looking for, but it might help:
"If you made the Windows partition too small
First, back up all the information on your Windows partition. Then run Boot Camp
Assistant to restore your disk to a single volume. Restart your computer and use Boot
Camp Assistant to partition the disk again and reinstall Windows. Don’t forget to install
the Boot Camp drivers after installing Windows."
(from Bootcamp Assistant Manual see pg 22) -
I have set up several EVENTs for my photos in iPhoto. Now when I click on an Event, I want to arrange the pictures within this event , when I click on the picture I want to move, it does not move, it stays in place. ( yellow fram around the picture does appear ) I clicked on the VIEW tab, selected " sort EVENTS" than I slide over to manually and the word appears in grey rather than black . Therefore I am unable to move the picture to the place I want it to be within that same event. Please be kind and Help, thank you, manfred from jupiter
Hello Old Toad,
thank you for your reply, very much appreciated.
I am sending you the same anwer I sent out to LarryHN, since it covers the ame topic.....
My version of iPhoto is : " iPhoto 08 " , version 7.1.5 ( 378 )
I set up an " Album " as you suggested and this procedure works, I am able in this new Album to change the pictures around as I want it to be.
However in checking back at the same " Event" Album / Gallery the pictures still remain the old way and do not show the changes I made in the new Album version.
I guess that's the way it will be. Take it or leave it..... or do you have another suggestion ???? Thank you for looking into my problem. Please let me know. Thank you again manfred from jupiter -
Hi does anybody know how to tile print an image On an iMac ? So blow an image up and print that image on several pieces of paper . ?
Appreciate any help Thank you LauraThere's an app for that...
https://www.macupdate.com/app/mac/45688/tile-photos-fx
Also see...
http://www.blockposters.com -
I am from South Africa and the itune store only allows the purchase of some music , whenever i try to buy Jesus Culture- Everything . an error message comes up "only availble in US " , PLEASE HELP .Thank you
I had the same issue this morning downloading a pre-order of Alanis, Flavors of Entanglement . I noticed that the only thing that had changed fro me was that I had some song credits for purchasing ticketmaster tickets over the past few weeks. When I went ahead and spent my remaining credits... it downloaded with no prompting or trouble. Maybe the credits issues hangs it up?
-
I just brought 15$ App store card and wanted to buy a paid app but it says ''Your Purchase Could Not Be Completed" Can Somebody help me that would be helpful thank you.
Well, usually that message ends with ..."contact the iTunes Store."
http://www.apple.com/support/itunes/contact/ -
Lost all email gmail deleted by mistake need help thank you
lost all email gmail messages deleted by mistake need help thank you.
Mail 2.x doesn’t store mail in standard mbox format. The only way you might find Mail messages in a “recovered” mbox file is if it was a Mail 1.x file that Mail 2.x left there after the conversion to the new *.emlx format when you upgraded from Mac OS X 10.3 or earlier to Mac OS X 10.4.
If you’re running Mac OS X 10.4 (Tiger) and don’t have a backup, what you should have tried to recover are as many *.emlx files as possible. Data Rescue II may be able to do that, but the documentation doesn’t say so. The only data recovery utility that I know for sure can currently recover deleted *.emlx files is FileSalvage.
That said, you may still try to import those mbox files as Other (not as Mail for Mac OS X), and hope that they don’t contain garbage that causes Mail to crash — you may look at their contents with a text editor first to check whether there are actually any emails there.
Beware, however, that anything you do with the computer may cause the deleted *.emlx files to be overwritten if you don’t try to recover them first. -
hello guys! i just wanted to asked to anyone of you if you'll receive a notification when your icloud account was removed into your apple device? my iphone 4 Ios7 was stole 3 days before.. please help thank you!
1. you may have to take it in to Apple and get an out of warranty iphone for $199.
2. you can get your information from a backup of your phone. you do have a backup of your phone right either in iTunes or icloud. If you don't then your answer will be no. -
Hi Gurus,
I have a beginner in photoshop , I tried to copy a selection into new blank canvas however the layer in the new canvas becomes gray/black/white, did i wrongly click on something ? Please help , Thank you in advanceHow did you open the new document? What Image mode is the document in and what exactly did you copy to the clipboard? What was the current Photoshop target when you did the copy? Was it a straight copy or a copy merge etc...
Maybe you are looking for
-
How to get all data in a section from profile file?
Suppose I have profile ini have a section like: [Mysection] k1 =v1 k2=v2 the key-value pair could be dynamically in this section. then I want to get all data in Mysection. How can I get it in a loop for all in powerscript?
-
HT1660 I want to pick up the music on my iphone to my ipod how do i do this?
I have just bought an ipod nano and want to import my music from my iphone on to it how do I do this
-
Recovering data lost during change of unit of time for Info structure S061.
Dear Sir, I have changed the period unit from 'month' to 'week' through SPRO>Logistic Data Warehouse>Activate update. Due to this the data of Info Structure S061 is lost and when MCI3 transaction is executed the message " No Data found" message is sh
-
i am so tired. Have used many hours now to find a way to get my fotos from my Iphone to my PC'er (windows 7). I have downloaded Icloud, but I cannot aktivate "foto" When I click on icloud there comes a window, where it seems that I can click on foto.
-
Hi, Can any body give me an example of a IBAN number.What is the total composition like. I know its the is a combination of the following elements: - The bank country key - Check digit - Country-specific account number Regards Aravind