473,396 Members | 2,020 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

Change button properties

hi to all

i am developing a page using jsp and in that i am using script language as javascript. in that page i i have four text boxes and 4 buttons and required records are getting from database using jsp

operations of buttons are "Insert","Update","Delete","Exit". by default it is in Insert Mode. now any one can insert after filling all the details and press "Insert" button. Upto here there is no problem for me. it is working very well.

when ever i want to update my records i am facing problems. inorder to update my details press "Update" button. when ever i press "Update" button it automatically. i am waiting for you peoples replys


regarding
Apr 7 '07 #1
4 2402
acoder
16,027 Expert Mod 8TB
Can you post some code and what do you mean by update? Update what and how?
Apr 9 '07 #2
yes


Expand|Select|Wrap|Line Numbers
  1.  
  2. <html>
  3.      <head>
  4.      <script language="javascript">
  5.              function insert()
  6.             {
  7.                     //here i will write code for inserting data into database
  8.             }
  9.              function update()
  10.              {
  11.                    //here i will write code for updating data into database
  12.              }
  13.               function delete()
  14.              {
  15.                   //here i will write code for deleting data from database
  16.              }
  17.      </script>
  18.     </head>
  19.  
  20.        <body>
  21.            name:<input type=text name="t1"><br>
  22.            address<input type=textarea name="ta1"><br>
  23.            phone:<input type=text size=15 ><br><br>
  24.            <input type="button" onclick="Insert()" value=Insert"><br>
  25.           <input type="button" onclick="change()" value=change">
  26.      </body>
  27. </html>
  28.  

after loading this page bydefault button Insert function is insert(). now my requirement is when ever i press change button, "Insert" button must change there properties like value "Insert" to "Update", onclick=insert() to onclick=update() and so on.

this is what i want to explain to ypou people. can any one guide me how to do all these things


regards

Can you post some code and what do you mean by update? Update what and how?
Apr 10 '07 #3
acoder
16,027 Expert Mod 8TB
Give an id to your button, then in your change() function:
Expand|Select|Wrap|Line Numbers
  1. var btn = document.getElementById('buttonid');
  2. btn.value='Update';
  3. btn.onclick=update;
  4. }
Apr 11 '07 #4
acoder
16,027 Expert Mod 8TB
Changed thread title.
Apr 11 '07 #5

Sign in to post your reply or Sign up for a free account.

Similar topics

1
by: kjon | last post by:
Hi, I have a form which will perform some function in another module. After that, I need to update some form properties from within the module to show the status. How can I change the properties...
8
by: deko | last post by:
I'm trying to find a way to set form/control properties programmatically. In a nut shell: 1. Open a database 2. Open a form in design view 3. Do something like this: For Each prp In...
2
by: Smith Duggan | last post by:
I am attempting to change the background properties of a rectangle in the code, and have been stuck now for a day and a half. This is my first access app. Please be gentle with my steaming pile...
5
by: Wolfgang | last post by:
Dear all, I've a lot of buttons named button1..button100 and want to change some of there propertys. Maintaining the overview I'm looking for a possibility for something like: ...
0
by: Jacek Francuz | last post by:
Hi! How can I change button image end send file to Client in one request? I try to change image in first step and I add onstartupscript: "Form1.submit()" and then in second step I send...
2
by: sck10 | last post by:
Hello, I am trying to programically make the following TemplateField ("MyTemplate") visible when the user clicks on the "Edit" Button using the PreRender handle event. My question is, how do...
3
by: Mateusz Rajca | last post by:
Hello, I have Form1 - the main form with some controls including a button. I have Form2 - the properties form with a combobox and button. The user can select the colors of a button in the...
2
by: onionman07 | last post by:
I am having a problem with a program i am trying to develop that uses menus to modify and track current properties of controls on a form. I have 2 PictureBox controls where I can choose how to...
1
by: =?Utf-8?B?aXd1Y29tcHV0ZXJnZWVrMDU=?= | last post by:
I have encountered a frustrating problem with the VB environment, and I am afraid I need to re-install it on my system. I would like to know whether any of you have encountered the same problem or...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.