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.

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 ?

When I tried to Hide and Display buttons one after other is not working when buttons are inside the form.

I think this happens because #submit1 is a submit button. So when you click it, a new page loads before the sript can finish. Use an ordinary button instead, and only use a submit button if you want to submit the form.

QUOTE

This is working well when I am placing buttons except "SAVE" other buttons outside the form, here, the navigation is not working.

I'm sorry but this code makes no sense at all. How do you expect to show or hide elements when the form is submitted? Why so many submit buttons? If you want to show or hide elements you should use a normal button, not a submit button.

I don't do jQuery so I had to read the docs. According to what I read the jQuery id selector doesn't support an array of elements, but that's how you have used it

CODE

$("#div2, #div3,#div4, #div5").hide();

. How can the user enter a Note Number when the element is marked as readonly?

I can't run your page because you have CSS and Javascript files linked from your localhost. I don't have those files so your page won't work for me. Do you have a website where you can put your test page on the web so everyone can check it?

I'm sorry but this code makes no sense at all. How do you expect to show or hide elements when the form is submitted? Why so many submit buttons? If you want to show or hide elements you should use a normal button, not a submit button.

I don't do jQuery so I had to read the docs. According to what I read the jQuery id selector doesn't support an array of elements, but that's how you have used it

CODE

$("#div2, #div3,#div4, #div5").hide();

. How can the user enter a Note Number when the element is marked as readonly?

I can't run your page because you have CSS and Javascript files linked from your localhost. I don't have those files so your page won't work for me. Do you have a website where you can put your test page on the web so everyone can check it?

Thank you charles ji and Christian ji for your response,

Actual intention of hide and display is,

After click of SAVE button, NOTE button should appear and onclick of NOTE button the input values should carry to other php page viz., denote.php where, all the content is loaded in a prescribed format and enables printing accordingly. There I kept a BACK button which redirects to previous page. Then, SANCTION button would appear, which is another prescribed format will load with the input fields and enables printing.

This is what I need.

1. I changed all submit type to button as suggested.2. for the SAVE submit button I used as

but the SAVE submit button is hiding for 1 second only again it displaying. for the unknown reason. Can I put NOTE button display herein onclick event ?

Charles Ji, I am neither a professional web developer nor a software engineer. I am a Personal Assistant for an office. I am automating my work which accessible to a very limited persons (5 persons) over LAN (intranet). I dont have any website. I am very proud to say, I joined this forum in the year 2013 and by then with my interest and your support I reached from zero knowledge in php to current position. I really thank this forum.

After click of SAVE button, NOTE button should appear and onclick of NOTE button the input values should carry to other php page viz., denote.php

Then SAVE should be of type="button", and NOTE should be of type="submit". But it doesn't make senses to just hide SAVE onclick and show NOTE instead (then you could use the NOTE button alone, and get rid of the SAVE button). What more is the "SAVE" button doing?

QUOTE

There I kept a BACK button which redirects to previous page. Then, SANCTION button would appear, which is another prescribed format will load with the input fields and enables printing.

I don't understand this part. If the SANCTION button appears the page is not the same as it was previously, so you can't just redirect back to it.

Could you explain more of what the forms on each page should do (not just the click buttons)? To begin with, the naming of the different buttons is confusing to me: SAVE doesn't save anything, and I have no idea what the PHP scripts in denote.php and desanction.php are doing with the form data.

QUOTE

1. I changed all submit type to button as suggested.2. for the SAVE submit button I used as

but the SAVE submit button is hiding for 1 second only again it displaying. for the unknown reason.

It's because it's still a submit button, so after that 1 second the page is reloaded again to its default state. Don't use submit for SAVE, use submit for NOTE only. I'm not yet sure how and when the SANCTION button should be displayed.