• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

help me with this javascript code

 
Greenhorn
Posts: 26
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi all,

I am a newbie in javascript. I am developing an application where I have an html table displaying the records from the database. Each row has a check box and on clicking it and pressing delete button, the corresponding record gets deleted from the database. What I am trying to do is, when the user selects a record and clicks delete button a confirm window should pop-up asking for confirmation. also, if the user clicks delete without selecting any record, an alert window 'check the records to delete' should appear.
Here are the form tag and javascript code:

//form tag in index.jsp

<form name="del" id="frm" action="DeleteRecord">
<input type="submit" name="sub" value="Delete" onClick="validation();">
</form>

//javascript code in index.jsp


In the above code, the control will be transferred to servlet whatever is the user action. Please help me in modifying above code.

Thanks in advance.


 
Ranch Hand
Posts: 368
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Instead of using type as submit you can use simple button input tag.
onclick call method as you are calling.
when all condition will be fine just do del.submit();
 
Shashank Anand
Greenhorn
Posts: 26
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Shailesh,

Thank you very much for the help.
Now my code is working.

Regards,
Shashank.
 
Shailesh Narkhede
Ranch Hand
Posts: 368
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
You are welcome
reply
    Bookmark Topic Watch Topic
  • New Topic