The Web Design Group

... Making the Web accessible to all.

Welcome Guest ( Log In | Register )

> HIDE AND DISPLAY OF BUTTONS WITH JAVASCRIPT
shankar from vizag
post Jun 1 2019, 12:09 AM
Post #1


Advanced Member
****

Group: Members
Posts: 164
Joined: 18-June 13
Member No.: 19,316



Greetings

1. I have a form with input fields and some buttons.
2 Button1 is to save the data and onload of the form, all except save button, will remain in hide mode.
3. Onclick of the button1(save), button1 has to disappear and button2 value Note should display and onclick of this button has to carry 2 actions as,

(a) it should disappear and button3 value sanction should display and
(b) it should carry the entered values to another php form

Issues I am facing:

When the buttons are inside the form, hide and display actions are not working properly

When I placed the buttons outside the form, hide and display actions working perfectly but not navigating to the other php page. I am attaching the php page for your reference and guidance please.

regardsAttached File  hidebuttons.php ( 1.66k ) Number of downloads: 297
User is offlinePM
Go to the top of the page
Toggle Multi-post QuotingQuote Post
 
Reply to this topicStart new topic
Replies
shankar from vizag
post Jun 1 2019, 12:39 AM
Post #2


Advanced Member
****

Group: Members
Posts: 164
Joined: 18-June 13
Member No.: 19,316



I placed the following javascript to navigate to other php page,

<script type="text/javascript">
document.getElementById("note").onclick = function () {
location.href = "denote.php";
};
</script>

But the input values are not carry forward to designated places in denote.php rather I am getting an error message as follows:

Notice: Undefined index: notenum in C:\xampp\htdocs\ShankarProject\denote.php on line 51

Notice: Undefined index: note_date in C:\xampp\htdocs\ShankarProject\denote.php on line 52

As the method of the form is post and it seems with that only can fetch input values from hidebuttons.php file. If it so, how to hide and display buttons with php. will it be possible ?

regards
User is offlinePM
Go to the top of the page
Toggle Multi-post QuotingQuote Post
Christian J
post Jun 1 2019, 05:04 AM
Post #3


.
********

Group: WDG Moderators
Posts: 8,238
Joined: 10-August 06
Member No.: 7



QUOTE(shankar from vizag @ Jun 1 2019, 07:39 AM) *

I placed the following javascript to navigate to other php page,

<script type="text/javascript">
document.getElementById("note").onclick = function () {
location.href = "denote.php";
};
</script>

But the input values are not carry forward to designated places in denote.php

To make the INPUT values carry over to another URL you need to submit the form.
User is offlinePM
Go to the top of the page
Toggle Multi-post QuotingQuote Post
shankar from vizag
post Jun 1 2019, 05:30 AM
Post #4


Advanced Member
****

Group: Members
Posts: 164
Joined: 18-June 13
Member No.: 19,316



QUOTE(Christian J @ Jun 1 2019, 03:34 PM) *

QUOTE(shankar from vizag @ Jun 1 2019, 07:39 AM) *

I placed the following javascript to navigate to other php page,

<script type="text/javascript">
document.getElementById("note").onclick = function () {
location.href = "denote.php";
};
</script>

But the input values are not carry forward to designated places in denote.php

To make the INPUT values carry over to another URL you need to submit the form.


Thank you Christian ji for your response,

The submit button is named as save and placed all the other buttons inside the form then the navigation and carrying values are working well.

When I tried to Hide and Display buttons one after other is not working when buttons are inside the form. This is working well when I am placing buttons except "SAVE" other buttons outside the form, here, the navigation is not working.

Can formaction property which I placed in the input line be used in javascript ?

Kindly guide me.

regagrds
User is offlinePM
Go to the top of the page
Toggle Multi-post QuotingQuote Post

Posts in this topic


Reply to this topicStart new topic
1 User(s) are reading this topic (1 Guests and 0 Anonymous Users)
0 Members:

 



- Lo-Fi Version Time is now: 15th October 2019 - 03:48 AM