adammc
October 29, 2008, 8:27pm
1
HI guys,
Can anyone possibly expain why the following button is just sitting there and wont goto the url?
<form action=\\"http://www.google.com/index.php\\" method=\\"get\\"
target=\\"_self\\"><input type=\\"submit\\" value=\\"Continue Shopping\\"></form>
It does however work if I leave this existing code in; you can then click the bottom button to get to the url:
<form action='http://www.google.com/index.php' method='post' id='continueshopping'>
<input type='submit' VALUE='Continue Shopping'>
</form>
<form action=\\"http://www.google.com/index.php\\" method=\\"get\\"
target=\\"_self\\"><input type=\\"submit\\" value=\\"Continue Shopping\\"></form>
Why are the quotes escaped? (\") You should not escape those quotes.
Also, the first quote for the ‘action’ attribute of the form tag is not escaped, so that could be part of the problem.
adammc
October 29, 2008, 9:11pm
3
thanks for the reply.
I am escaping the quotes because the code is within a php script.
I fixed the action attribute like you suggested but it still wont do anything??
<form action=\\"http://www.google.com/index.php\\" method=\\"get\\" target=\\"_self\\">
<input type=\\"submit\\" value=\\"Continue Shopping\\">
</form>
adammc
October 29, 2008, 9:22pm
4
Thanks, I Got it sorted using:
<FORM>
<INPUT TYPE='BUTTON' VALUE='Continue Shopping' ONCLICK=\\"window.location.href='http://www.domain.com/store/'\\">
</FORM>
Also, you are missing the closing of the input tag:
<input … />
Maybe it’s that? What’s the output you see on the browser (view source code)
Karpie
October 30, 2008, 1:51am
6
You haven’t fixed the action attribute… you’re still escaping every double quote after the first one. What’s the PHP line you’re using to output that form tag?
Your ‘sorted’ method is still escaping what it shouldn’t…
adammc
October 30, 2008, 2:01am
7
OK…now I am really stumped LOL
The update button below works in Firefox but in IE the button wont press???
<td width=\\"33%\\" align=\\"center\\" scope=\\"col\\" valign=\\"center\\">
<form name=\\"continue\\">
<input type=\\"button\\" value=\\"Continue Shopping\\" onclick=\\"window.location.href='http://www.aaaaa.com.au/store/'\\" />
</form>
</td>
<td width=\\"33%\\" align=\\"center\\" scope=\\"col\\" valign=\\"center\\">
<input type=\\"submit\\" value=\\"Update Cart\\" /></form>
</td>
If I remove the first td cell and contents the update cart button works in both IE and firefox.
Can anyone possibly assist?
adammc
October 30, 2008, 2:04am
8
$output[] = "form code here";
$output[] = "form code here";
return join('',$output);
joaquin_win:
Also, you are missing the closing of the input tag:
<input … />
Maybe it’s that? What’s the output you see on the browser (view source code)
http://www.w3.org/TR/html401/interact/forms.html
What if he is using html 4.01?
adammc
October 30, 2008, 5:22am
10
I am using XHTML 1.0 Strict
Karpie
October 30, 2008, 8:03am
11
OK. Look at the code. The syntax colouring straight away should tell you there’s a problem - you’re opening the first string for the table cell with a double quote, but escaping all the closing double quotes (\" instead of "), so that it never actually gets closed. I’m surprised it works anywhere.
And thank you for not posting the actual code like I asked -_-
What’s the actual output? from the view page source in the browser?
Instead of using double quotes and escaping them wiith the backslash, just use single quotes…