Link to home
Start Free TrialLog in
Avatar of xamian
xamian

asked on

lost form variables in Safari

I have a very simple html form.  When the form goes to the action page the browser generates a ColdFusion error telling me that the form variable does not exist.  I know for a fact that it does because the database update that takes place on the action page runs perfectly and the form information is added to the database, but for some unkown reason Safari says that the variable does not exist.

This error is only occuring on the Macintosh running OS X, Safari 2.2.  Every major browser on the PC platform works fine as does FireFox for the Mac.

I am completely dumbfounded, any insight would be appreciated.

Avatar of SidFishes
SidFishes
Flag of Canada image

we'll probably need to see some code
Avatar of Oneiroid
Oneiroid

Please post your form code, update code, and code causing the error.
Avatar of xamian

ASKER

***The form***
<form action="index.cfm?Trg=6&session_id=#url.session_id#" method="post" enctype="multipart/form-data">
<input name="product_id" type="hidden" value="#Trim(product_id)#" />
<select name="qty">
<cfloop index="TheQty" from="1" to="20">
<option value="#Trim(TheQty)#">#TheQty#</option>
</cfloop>
</select>
<input name="" type="submit" value="Update" style="font-size:9pt;" />
</td>
</form>
***/The form***

***The Action Page***
<cfquery name="UpdateQty" datasource="#appdsn#">
UPDATE shopping_cart_tbl SET qty = #Trim(Form.qty)#
WHERE session_id = '#url.session_id#' AND product_id = #Trim(Form.product_id)#
</cfquery>
<cflocation url="index.cfm?Trg=4&session_id=#url.session_id#">
***/The Action Page***

The error basically says #Form.qty# cannot be found.  The update actually takes place, but the page says the variable doesn't exist.
Is the Action Page the same page that contains your update code?

Please post your update code since that does seem to work for you.
Sorry, my error. Update code is pasted. You mentioned above that the update worked, but you received an error later on: that is the code I mean to ask for. Is that correct?
If Safari doesn't recognize your *update*, and that is where the error is occuring, it may be sensitive to the capital 'F' in Form.qty (and if so, will be to your other form variables too) - I can't test this right now but I can't see anything else that should effect that code.

Avatar of xamian

ASKER

Never mind guys I just solved it.

Apparently safari doesn't like it when you use a relative link in the CFLOCATION tag.

after I changed:
<cflocation url="index.cfm?Trg=4&session_id=#url.session_id#">
to
<cflocation url="https://www.mywebsite.com/index.cfm?Trg=4&session_id=#url.session_id#">
It looks like safari needed the full path.  I'm not getting the errors I was encountering before.

Thanks for trying.
Please submit a request to close this question and refund points.
ASKER CERTIFIED SOLUTION
Avatar of kodiakbear
kodiakbear

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial