Thanks to everybody.
Problem solved!
It was simple syntax error not detected by the system.
Thanks for all your help!
Announcement
Collapse
No announcement yet.
Passing variables to log module from page tamplate
Collapse
X
-
If it worked correctly with a text box, it should work correctly with a hidden input, if the hidden input is written in the same place, and has the same name and value. I would take a closer look at the hidden input; maybe it has a missing character or other small error that the compiler isn't catching. Also, if you're doing this on a Miva shopping page, you might check to make sure that there isn't any Javascript or CSS that's affecting the behavior.
Leave a comment:
-
Originally posted by compumate99 View PostYes, before I converted to hidden field, I checked using the following code.
Code:<input type="text" name=name="myvar" value="some value">
Code:<MvIF EXPR="{ (len(g.myvar) GT 0 }"> <MvEVAL EXPR="{ 'passed value = ' $ g.myvar }"> </MvIF>
Leave a comment:
-
Another explanation:
g.myvar hasn't been populated yet because it's still CGI and MvEval doesn't know about CGI variables.
This is your CGI variable:
Code:<input type="text" name="myvar" value="some value">
Code:<mvt:assign name="g.myvar" value="myvar" />
Then this should work:
Code:<MvEVAL EXPR="{ 'passed value = ' $ g.myvar }">
Well, it should work if the value is there when all the mivascript code is rendered, meaning, when the mvt:assign statement executes it will copy the CGI value to the mivascript variable value.
Leave a comment:
-
Hello Kent,
It was tested with
Code:<input type="text" name=name="myvar" value="some value">
As shown in output result, module is actually fired correctly, which also means the form is submitted.
Anything else I should check?
Daniel
Leave a comment:
-
The first thing I'd recommend is to check that the hidden input is actually inside a form, and also check that the form is actually being submitted. Some Miva pages have a complex design, with multiple forms, and also links and buttons that take you to another page without submitting any form.
When you used a text box instead of a hidden input, did that work correctly?
Hope that helps --
Leave a comment:
-
If I am understanding what you need to do, the value of the variable won't available to the Log module. If the form is on the same page, you'd need to refresh or ajax the page with that form field value as a CGI variable so the log module routine can move/copy it into a Mivascript variable value. It's not available initially because the page renders before your form or variable is processed or populated.
Scott
Leave a comment:
-
Yes, before I converted to hidden field, I checked using the following code.
Code:<input type="text" name=name="myvar" value="some value">
Leave a comment:
-
The first thing to do is check the source of the page where the hidden input is and make sure the value field has something in it. It could be that you're not getting anything because it's not passing anything.
Leave a comment:
-
Are you testing the 'g.myvar' to verify it is being populated before you try to write it out?
Leave a comment:
-
Passing variables to log module from page tamplate
Hello,
I am trying to pass a variable to a log module from a form, but it does not pass variable.
In form,
Code:<input type="text" name="myvar" value="some value">
Code:<MvEVAL EXPR="{ 'passed value = ' $ g.myvar }">
Code:passed value =
What would be long in this code?
Thanks for helpLast edited by compumate99; 09-17-18, 11:34 AM.Tags: None
Leave a comment: