Your SAS programs, embedded in web apps and elsewhere

using type = image vs input type=submit in html tag

Reply
Regular Contributor
Posts: 163

using type = image vs input type=submit in html tag

Hi:
I have a stored process that creates a custom html form that requires the user to submit once they have the form. This submit is created by



So I want to replace the "Click" with an image. However, I create a macro variable name ( called macrovariable, see above, created by the name attribute) that gets changed to something weird. As soon as a click happens on the click image the stored process gives me the following with no Log:

"macrovariable.x" is an invalid name because it contains characters other than alphanumerics or underscore.

This happens only when I change the input type to "image"

Any help?
SAS Super FREQ
Posts: 306

Re: using type = image vs input type=submit in html tag

Did you view the source of the resulting HTML page to insure that the NAME attribute is correct (does not contain ".x")?

Vince DelGobbo
SAS R&D
Regular Contributor
Posts: 163

Re: using type = image vs input type=submit in html tag

Posted in reply to Vince_SAS
Vince,
Correct. I can change the name to name="test" and I will get the error mentioned, no log, and will test.x in the error sentence.

jp
SAS Super FREQ
Posts: 8,868

Re: using type = image vs input type=submit in html tag

Hi:
An interesting discussion here
http://www.cs.tut.fi/~jkorpela/forms/imagebutton.html

seems relevant, when it explains a LOT of the reasons you might NOT want to use an image as a SUBMIT button, and this is in one of those explanations:
beginquote

The reason to this is the way in which image submit buttons contribute to form data set: the value of the VALUE attribute is ignored, and the coordinates of the clicked location are passed instead. For example, if you have , then the form data set contains the fields foo.x and foo.y, with numeric values that indicate the x and y coordinates of the clicked location.

endquote


So it seems you're running into standard browser behavior with the suffix of .X to the name= attribute value.

cynthia
Regular Contributor
Posts: 163

Re: using type = image vs input type=submit in html tag

Posted in reply to Cynthia_sas
Cynthia,
that might explain it. Thank you!

jp
Ask a Question
Discussion stats
  • 4 replies
  • 293 views
  • 0 likes
  • 3 in conversation