Hi there... I have a html page that i have to use as a template page for an exucuting CGI file. (search engine). that source can not be modified on that CGI. The CGI file pulls in the template file and provides a way to format the resulting CGI output. (the htm template have has CSS in it to formate the CGI resulting page) of cource with html being stateless .. i have no way to put a feed drop down on that htm template that is populated from the Db. Least by conventional methods... Is it possible to feed a drop down onto an HTML page that populated from a DB using and then post the result to the page (once form is submitted)? IE.. a list of authors or something? This does not sound like an easy thing to do.. Thanks for any help in this matter... Terry _______________________________________________ Rails-spinoffs mailing list Rails-spinoffs-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org http://lists.rubyonrails.org/mailman/listinfo/rails-spinoffs
Kjell Bublitz
2006-Jun-16 10:56 UTC
Re: can someone please show me how to feed a drop down ....
Erm.. i am not sure if i really understood what you are trying to do. It sounds that you can''t edit the template you are refer to so.. you should have a look on the script.aculo.us Builder functions. With them you can create your dropdown with javascript and "attach" it anywhere in the DOM of your result or searchpage. No need to edit HTML then. var myFormID = ''search''; var myDropDown = Builder.node(''select'', {name:''searchtype''}, [ Builder.node(''option'', {value:''1''}, [''fruits'']); Builder.node(''option'', {value:''2''}, [''music'']); Builder.node(''option'', {value:''3''}, [''cars'']); ]); $(myFormID).appendChild( myDropDown ); I hope this helps you. On 6/16/06, Stripe-man <remsikt-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> > Hi there... > > I have a html page that i have to use as a template page for an exucuting > CGI file. (search engine). that source can not be modified on that CGI. > > The CGI file pulls in the template file and provides a way to format the > resulting CGI output. (the htm template have has CSS in it to formate the > CGI resulting page) > of cource with html being stateless .. i have no way to put a feed drop > down on that htm template that is populated from the Db. Least by > conventional methods... > > Is it possible to feed a drop down onto an HTML page that populated from a > DB using and then post the result to the page (once form is submitted)? > IE.. a list of authors or something? > > This does not sound like an easy thing to do.. > > Thanks for any help in this matter... > > Terry > > > > > _______________________________________________ > Rails-spinoffs mailing list > Rails-spinoffs-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org > http://lists.rubyonrails.org/mailman/listinfo/rails-spinoffs > > >_______________________________________________ Rails-spinoffs mailing list Rails-spinoffs-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org http://lists.rubyonrails.org/mailman/listinfo/rails-spinoffs
Stripe-man
2006-Jun-16 11:03 UTC
Re: can someone please show me how to feed a drop down ....
Thanks so much for your reply... JS would work.. thast why I thought to email this list... but i dont understand what Builder functions you are refering to on his site... please note that I am fairly new to JS and definatly new to this ajax stuff. do you or would you happen to have a working example.. I can edit the template file.. but its the CGI file that I can not edit. The CGI points to the template file internally.. (cant mod the CGI because its complied c++) and the template is a htm file with only css info in it (the head tags) I think thats why JS will work... in doing what im trying to do.. i hope.. does this make a little more sence ? Tanks much , Terry On 6/16/06, Kjell Bublitz <m3nt0r.de-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> > Erm.. i am not sure if i really understood what you are trying to do. It > sounds that you can''t edit the template you are refer to so.. you should > have a look on the script.aculo.us Builder functions. With them you can > create your dropdown with javascript and "attach" it anywhere in the DOM of > your result or searchpage. No need to edit HTML then. > > var myFormID = ''search''; > var myDropDown = Builder.node(''select'', {name:''searchtype''}, [ > Builder.node(''option'', {value:''1''}, [''fruits'']); > Builder.node(''option'', {value:''2''}, [''music'']); > Builder.node(''option'', {value:''3''}, [''cars'']); > ]); > $(myFormID).appendChild( myDropDown ); > > I hope this helps you. > > > On 6/16/06, Stripe-man < remsikt-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote: > > > Hi there... > > I have a html page that i have to use as a template page for an exucuting > CGI file. (search engine). that source can not be modified on that CGI. > > The CGI file pulls in the template file and provides a way to format the > resulting CGI output. (the htm template have has CSS in it to formate the > CGI resulting page) > of cource with html being stateless .. i have no way to put a feed drop > down on that htm template that is populated from the Db. Least by > conventional methods... > > Is it possible to feed a drop down onto an HTML page that populated from a > DB using and then post the result to the page (once form is submitted)? > IE.. a list of authors or something? > > This does not sound like an easy thing to do.. > > Thanks for any help in this matter... > > Terry > > > > > _______________________________________________ > Rails-spinoffs mailing list > Rails-spinoffs-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org > http://lists.rubyonrails.org/mailman/listinfo/rails-spinoffs > > > > > _______________________________________________ > Rails-spinoffs mailing list > Rails-spinoffs-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org > http://lists.rubyonrails.org/mailman/listinfo/rails-spinoffs > > >-- "I have learned that you should''nt compare yourself to others - they are more screwed up than you think." ...unknown "In the 60''s, people took acid to make the world weird. Now the world is weird and people take Prozac to make it normal." ..unknown _____________________________ Terry Remsik stripe-man.dyndns.org remsikt-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org _______________________________________________ Rails-spinoffs mailing list Rails-spinoffs-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org http://lists.rubyonrails.org/mailman/listinfo/rails-spinoffs
Kjell Bublitz
2006-Jun-16 11:32 UTC
Re: can someone please show me how to feed a drop down ....
Yes, i think i know now.. Download the script.aculo.us package (thats one of the maintopics in this list). Within are various javascript files. For what you are will only need the "prototype.js" and the "builder.js" in your Head-Tag. <script src=... etc..> Now what you need to know is the name, or even better the "id" of your Form-Tag (from the CGI), because the javascript needs to know where to generate our drop-down. In my example i provided a variable for this named "myFormID" and set it to "search" assuming your form-tag looks like so: <form action="your.cgi" method="post" id="search"> You can change that to your needs, should work assuming you have an id= in your form. Since you said that it uses CSS it is most likely the case... Next i begin to create a select box with it''s options. My example will create HTML like so: <select name="searchtype"> <option value="1">fruits</option> <option value="2">music</option> <option value="3">cars</option> </select> And finally we use our "myFormID" and add our new select box. This is done with "appendChild". Child is because Form is our parent (i.e. the next higher element). Now if someone submits that form the value of "searchtype" will be submitted. I don''t know how you implemented this search-form in particular, a link would help, but this is the basic procedure i would follow using javascript. To use the Builder function/example i suggest to add a script-block containing the Builder.node code right below your search-form. Regards, Kjell On 6/16/06, Stripe-man <remsikt-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> > Thanks so much for your reply... JS would work.. thast why I thought to > email this list... > but i dont understand what Builder functions you are refering to on his > site... please note that I am > fairly new to JS and definatly new to this ajax stuff. do you or would > you happen to have a working example.. > > I can edit the template file.. but its the CGI file that I can not edit. > > The CGI points to the template file internally.. (cant mod the CGI because > its complied c++) > and the template is a htm file with only css info in it (the head tags) I > think thats why JS will work... in doing what im trying to do.. > i hope.. does this make a little more sence ? > > Tanks much , > Terry > > > On 6/16/06, Kjell Bublitz <m3nt0r.de-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org > wrote: > > > > Erm.. i am not sure if i really understood what you are trying to do. It > > sounds that you can''t edit the template you are refer to so.. you should > > have a look on the script.aculo.us Builder functions. With them you can > > create your dropdown with javascript and "attach" it anywhere in the DOM of > > your result or searchpage. No need to edit HTML then. > > > > var myFormID = ''search''; > > var myDropDown = Builder.node(''select'', {name:''searchtype''}, [ > > Builder.node(''option'', {value:''1''}, [''fruits'']); > > Builder.node(''option'', {value:''2''}, [''music'']); > > Builder.node(''option'', {value:''3''}, [''cars'']); > > ]); > > $(myFormID).appendChild( myDropDown ); > > > > I hope this helps you. > > > > > > On 6/16/06, Stripe-man < remsikt-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote: > > > > > Hi there... > > > > I have a html page that i have to use as a template page for an > > exucuting CGI file. (search engine). that source can not be modified on > > that CGI. > > > > The CGI file pulls in the template file and provides a way to format the > > resulting CGI output. (the htm template have has CSS in it to formate the > > CGI resulting page) > > of cource with html being stateless .. i have no way to put a feed drop > > down on that htm template that is populated from the Db. Least by > > conventional methods... > > > > Is it possible to feed a drop down onto an HTML page that populated from > > a DB using and then post the result to the page (once form is submitted)? > > IE.. a list of authors or something? > > > > This does not sound like an easy thing to do.. > > > > Thanks for any help in this matter... > > > > Terry > > > > > > > > > > _______________________________________________ > > Rails-spinoffs mailing list > > Rails-spinoffs-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org > > http://lists.rubyonrails.org/mailman/listinfo/rails-spinoffs > > > > > > > > > > _______________________________________________ > > Rails-spinoffs mailing list > > Rails-spinoffs-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org > > http://lists.rubyonrails.org/mailman/listinfo/rails-spinoffs > > > > > > > > > -- > "I have learned that you should''nt compare yourself to others - they are > more screwed up than you think." ...unknown > > "In the 60''s, people took acid to make the world weird. Now the world is > weird and people take Prozac to make it normal." ..unknown > _____________________________ > Terry Remsik > stripe-man.dyndns.org > remsikt-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org > > _______________________________________________ > Rails-spinoffs mailing list > Rails-spinoffs-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org > http://lists.rubyonrails.org/mailman/listinfo/rails-spinoffs > > >_______________________________________________ Rails-spinoffs mailing list Rails-spinoffs-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org http://lists.rubyonrails.org/mailman/listinfo/rails-spinoffs
Stripe-man
2006-Jun-16 11:45 UTC
Re: can someone please show me how to feed a drop down ....
ok.. i will see if i can get the id from the cgi file.. (will have to ask them for it) its gets a bit trickier because the script must point to an php page to do this work so that it can be populated backinto the htm page (templatepage..) do u think the above (once i get the id name) will work ? On 6/16/06, Kjell Bublitz <m3nt0r.de-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> > Yes, i think i know now.. Download the script.aculo.us package (thats one > of the maintopics in this list). Within are various javascript files. For > what you are will only need the " prototype.js" and the "builder.js" in > your Head-Tag. > <script src=... etc..> > > Now what you need to know is the name, or even better the "id" of your > Form-Tag (from the CGI), because the javascript needs to know where to > generate our drop-down. > > In my example i provided a variable for this named "myFormID" and set it > to "search" assuming your form-tag looks like so: > <form action="your.cgi" method="post" id="search"> > > You can change that to your needs, should work assuming you have an id= in > your form. Since you said that it uses CSS it is most likely the case... > > Next i begin to create a select box with it''s options. > My example will create HTML like so: > <select name="searchtype"> > <option value="1">fruits</option> > <option value="2">music</option> > <option value="3">cars</option> > </select> > > And finally we use our "myFormID" and add our new select box. This is done > with "appendChild". Child is because Form is our parent (i.e. the next > higher element). > > Now if someone submits that form the value of "searchtype" will be > submitted. > > I don''t know how you implemented this search-form in particular, a link > would help, but this is the basic procedure i would follow using javascript. > To use the Builder function/example i suggest to add a script-block > containing the Builder.node code right below your search-form. > > Regards, > Kjell > > On 6/16/06, Stripe-man <remsikt-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org > wrote: > > > > Thanks so much for your reply... JS would work.. thast why I thought to > > email this list... > > but i dont understand what Builder functions you are refering to on his > > site... please note that I am > > fairly new to JS and definatly new to this ajax stuff. do you or would > > you happen to have a working example.. > > > > I can edit the template file.. but its the CGI file that I can not edit. > > > > The CGI points to the template file internally.. (cant mod the CGI > > because its complied c++) > > and the template is a htm file with only css info in it (the head tags) > > I think thats why JS will work... in doing what im trying to do.. > > i hope.. does this make a little more sence ? > > > > Tanks much , > > Terry > > > > > > On 6/16/06, Kjell Bublitz <m3nt0r.de-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org > wrote: > > > > > > Erm.. i am not sure if i really understood what you are trying to do. > > > It sounds that you can''t edit the template you are refer to so.. you should > > > have a look on the script.aculo.us Builder functions. With them you > > > can create your dropdown with javascript and "attach" it anywhere in the DOM > > > of your result or searchpage. No need to edit HTML then. > > > > > > var myFormID = ''search''; > > > var myDropDown = Builder.node(''select'', {name:''searchtype''}, [ > > > Builder.node(''option'', {value:''1''}, [''fruits'']); > > > Builder.node(''option'', {value:''2''}, [''music'']); > > > Builder.node(''option'', {value:''3''}, [''cars'']); > > > ]); > > > $(myFormID).appendChild( myDropDown ); > > > > > > I hope this helps you. > > > > > > > > > On 6/16/06, Stripe-man < remsikt-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote: > > > > > > > Hi there... > > > > > > I have a html page that i have to use as a template page for an > > > exucuting CGI file. (search engine). that source can not be modified on > > > that CGI. > > > > > > The CGI file pulls in the template file and provides a way to format > > > the resulting CGI output. (the htm template have has CSS in it to formate > > > the CGI resulting page) > > > of cource with html being stateless .. i have no way to put a feed > > > drop down on that htm template that is populated from the Db. Least by > > > conventional methods... > > > > > > Is it possible to feed a drop down onto an HTML page that populated > > > from a DB using and then post the result to the page (once form is > > > submitted)? IE.. a list of authors or something? > > > > > > This does not sound like an easy thing to do.. > > > > > > Thanks for any help in this matter... > > > > > > Terry > > > > > > > > > > > > > > > _______________________________________________ > > > Rails-spinoffs mailing list > > > Rails-spinoffs-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org > > > http://lists.rubyonrails.org/mailman/listinfo/rails-spinoffs > > > > > > > > > > > > > > > _______________________________________________ > > > Rails-spinoffs mailing list > > > Rails-spinoffs-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org > > > http://lists.rubyonrails.org/mailman/listinfo/rails-spinoffs > > > > > > > > > > > > > > > -- > > "I have learned that you should''nt compare yourself to others - they are > > more screwed up than you think." ...unknown > > > > "In the 60''s, people took acid to make the world weird. Now the world > > is weird and people take Prozac to make it normal." ..unknown > > _____________________________ > > Terry Remsik > > stripe-man.dyndns.org > > remsikt-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org > > > > _______________________________________________ > > Rails-spinoffs mailing list > > Rails-spinoffs-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org > > http://lists.rubyonrails.org/mailman/listinfo/rails-spinoffs > > > > > > > > _______________________________________________ > Rails-spinoffs mailing list > Rails-spinoffs-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org > http://lists.rubyonrails.org/mailman/listinfo/rails-spinoffs > > >-- "I have learned that you should''nt compare yourself to others - they are more screwed up than you think." ...unknown "In the 60''s, people took acid to make the world weird. Now the world is weird and people take Prozac to make it normal." ..unknown _____________________________ Terry Remsik stripe-man.dyndns.org remsikt-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org _______________________________________________ Rails-spinoffs mailing list Rails-spinoffs-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org http://lists.rubyonrails.org/mailman/listinfo/rails-spinoffs