Exit
  • Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
  • 한국 커뮤니티
0

Using cfselect onBlur to reload page using a Flash form

New Here ,
Mar 24, 2010 Mar 24, 2010

I am having trouble trying to get <cfselect onBlur=""> to work inside of a <cfform format="flash"> using Flash. As soon as I put any value into the quotation marks, the Flash form no longer displays.

1.6K
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines

correct answers 1 Correct answer

Enthusiast , Mar 24, 2010 Mar 24, 2010

CFSELECT does not support onblur. But why would you use that? A select control does not "blur" when you change the value. You can use onchange.

<cfselect name="fish" onChange="getURL('newUrl.cfm?page='+fish.text)">

...

--

-Fernis - fernis.net - ColdFusion Developer For Hire

Translate
Enthusiast ,
Mar 24, 2010 Mar 24, 2010

CFSELECT does not support onblur. But why would you use that? A select control does not "blur" when you change the value. You can use onchange.

<cfselect name="fish" onChange="getURL('newUrl.cfm?page='+fish.text)">

...

--

-Fernis - fernis.net - ColdFusion Developer For Hire

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Mar 25, 2010 Mar 25, 2010

Even onchange didn't work. But I will try with the syntax that you are showing here.

The reason I wanted to have the page refresh is when I choose a different select option, I wanted the page to go back to the database and based on that selection change the value displayed on the page for the number of items added for that selection.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Mar 25, 2010 Mar 25, 2010

The current code I have using your syntax is the following:

<cfset thisPage = "http://#cgi.server_name#">
<cfif len(trim(cgi.server_port))>
<cfset thisPage ="#thisPage#:#cgi.server_port##cgi.script_name#?#cgi.query_string#">
<cfelse>
<cfset thispage ="#thisPage##cgi.script_name#?#cgi.query_string#">
</cfif>

<cfform name="fQuiz" preloader="false" format="flash" height="750" preservedata="yes">

...

<cfselect query="qDescriptionsByInteraction" name="description" id="s3" display="MEDIABITNAME" value="MEDIABITID" width="200" label="Description (video):" onChange="getURL('#thispage#')"></cfselect>

...

</cfform>

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Mar 25, 2010 Mar 25, 2010

Now, when I change the select nothing happens. Maybe this is because I am trying to just

load the current page so that the page looks for the new value based on what is now selected.


Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Mar 25, 2010 Mar 25, 2010

Now when I refreshed the page, I am getting a result when I change the select's value. I just have to now fix a problem with

Variable NEXTNUM is undefined.

Thank you for helping me get the select to respond to my input.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Enthusiast ,
Mar 25, 2010 Mar 25, 2010

I'm glad you got it working. Your latest error message is however totally unrelated to anything we've seen. You are just trying to access a variable named "nextnum" somewhere in your code without assigning it first on the same page (or defining a default value for it with cfparam).

-Fernis

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Mar 25, 2010 Mar 25, 2010

I fixed that problem by assigning a value to nextNum inside the conditional block for if as I recall, last night, which may have been this morning as long as I had worked yesterday.

Thanks again for getting my cfselect code back on track, because at one point I was using window.location and location.href and it wasn't doing anything. I guess I needed to use actionscript syntax.

I eventually used submitForm() but later decided to wait until I clicked the submit button anyway so that I could populate the form with the new select value and textFields.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Jun 30, 2010 Jun 30, 2010
LATEST

I had the same problem, but using geturl() work to reload the page But every time a used it The page shows "form data has expired"

I want to submit the page instead to reload. Becuase if I click submit bottom I have created works fine.

Thanks

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Mar 25, 2010 Mar 25, 2010

I guess the reason why the onchange="window.location..." technique was not working is because this is a flash and not html form and you have to use ActionScripts's getUrl technique for cfselect onchange.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Resources