Form on PHP page with multiple submits changes CSS of page - php

I've created a PHP web form which when all the data is present has 2 submit buttons (Continue and Print). Continue calculates details based on the entered information and displays it on the page. Print performs the same calculations, but then creates a PDF in a new window.
When I click Print the original page still loads (which is fine) but the styling is altered.
To see what I mean head to this page and for speed enter "1" in all text boxes except Position (which must be text). After you've clicked Continue, click Print to generate a PDF, then look back at the original web page to see altered styling.
Any ideas would be useful.
Thanks,
Adrian

Assuming you mean the tables overrunning the footer, get rid of the height: 100%; on #prodselector_text, solves the issue for me.

Related

Page transition, Load new page in a div while changing URL location

I'm familiar with the Ajax/jQuery .load() or php include() which can be used to load other content into a div on a page.
Kindly take a look at this example I've posted: my site with page transitions
How I've set up this page is, the body is 100% of the screen with no overflow. There is the blue section which is 100% height and the red section which is 100% height positioned 100% from the top. When you click the button the blue div is scaled back and the red div is transitioned to top: 0;.
My problem when you hit the back button, it doesn't go back to the blue section, it goes back to the previous page (blue page).
My question is how can I set this up so the red div (2nd one) will actually change the url (and load another php page into it using include(); or some other method)? For example when you click the button on the blue page, the red page will show up (with the included content) and the url will change to: davidfateh.com/red. I realize hitting the back page won't give me the transition, but at least it will go back to the blue page, which is my goal.
Thanks for looking and for any advice! Cheers!
So basically you show the same page, just different part of it. That is why hitting the back goes to the previous page, not the previous section, which is actually on the same page.
You can do what you want like this:
Create 2 different php files. red.php and blue.php
In each file have only the part you want.
the buttons now have to send from one page to the other. How to do this, depends on how you implemented your existing button.
For example, if the buttons are implemented like forms, use something like this:
<form action="red.php"> in one and <form action="blue.php"> in the other.
By pressing the button it will jump from one page to the other.

Back button on pages with tabs

I'm doing a system where the pages are displayed by tabs (easytabs Plugin http://os.alfajango.com/easytabs/#tabs1-js)
At one point in the process it performs a query in the database, where we
see all the details of each item that appears. I'd like to go into the details of the item, click back to the (on broswer or a button) the page to return to the list displayed by the SQL query, just as with any single page, but currently it only displays a blank page.
I wonder how can I do to implement this solution using the layout tabs.
Thank you.
There are various ways to maintain UI state. One of them is using a "url hash". For example, you click tab 2, change the url hash to:
mypage.php#tab=2
Then if someone presses BACK and goes FORWARD, you use JavaScript to look at the URL has and determine that the user had previously pressed tab 2, so you run your own bit of code that triggers the same event.
I'm unfamiliar with "easytabs" so I'm sorry I can't help with the specific implementation details, but that's the gist of the technique.

How do I make the iframe(child) from another iframe(parent) bigger than the its parent?

I'm creating a Purchase Order form in PHP and Fancybox and I'm having a hard time making a UI wherein inside a page the user can select a supplier and then after that a hyperlink will appear that will allow the user to add an item and once clicked another modal window is shown where a form containing the list of items are displayed as well as the quantity.
I was already able to do all the php coding correctly my problem now is that once I open the first Iframe the second Iframe becomes very small(which is what is expected because of the script 'width' and 'height'). Is there a way to work around this?
I already know how to get back to the previous iframe, I did that by adding a submit button with a form action="mypage".
Sir/Ma'am your answers would be of great help. Thank you.

jquery ajax with slideDown not working on first click

I am using ajax to grab two pieces of text from a seperate script with jQuery. I have done the check and the script correctly sends the infomation to the original php page.
I have a div container that holds the tags with the text in them. These <p> tags have a class name of summary_text.
<p class='fight_summary_text'>a random piece of text</p>
The first <p> tag is populated with information when the php page loads. When a button is clicked, the jQuery is fired off and two more pieces of information should follow:
$(".summary_text:first").before(data.message_one).slideDown(750, function() {
$(".summary_text:first").before(data.message_two).slideDown(750);
});
The problem I am having is that the first piece of information is inserted correctly on the page. It slides down and works fine, but the second piece of information does not appear.
However, that alone is not the problem. If I click the button a second time, both pieces of text appear correctly one after the other.
Does anyone know what is causing this? As I can't seem to locate the problem as it works when the button is clicked a 2nd, 3rd, 4th time etc.
I'm not sure if i understood your requirements correctly, but I tried and put together a fiddle. The problem I saw was the order of the statements.

Strange reload effect in Firefox

I have a page generated by php which includes two drop-down lists (SELECTs) which contain a lot of items (about 2,000 each). The page is fine, but when it loads in Firefox, there's a delay during the load, and then it seems to refresh the entire page. If a user tries to click on anything before the "reload" occurs, it has no effect.
In Explorer, each drop-down just takes a while (a second or two) to appear, which is fine.
Anyone know what this is? And aside from using AJAX to dynamically fill the drop-down list, is there an easy way to avoid it?
EDIT: Additional information. I have got my PHP script to output to a log file whenever it is called, so I can now see that what seems to be happening is this:
A call is made to the PHP script, and the page starts to load. After a few seconds, another identical call is made to the PHP script, at which point the page starts to load again. This time it completes loading. So I guess it seems like the browser refreshes the page automatically for some reason before the page finishes loading.
Wild shot in the dark: Do you have any images or hidden image submit buttons with BLANK src? I needed to 'fake' a 'default enter' effect for a textbox and used a hidden image button before all the fields. Since it was hidden, I left the src attribute blank. Firefox loaded the page twice! Pointing the src attribute at a single-pixel but real image fixed it.
First, you should use a network sniffer like wireshark to confirm that the page really loads twice.
Then, confirm that it happens only with firefox;
Then, you are on the good way ! I experienced a variant of what n8wrl is proposing; it was in some css declarations with some empty background-image property --> Check your CSS for empty file declarations

Categories