• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Tim Cooke
  • Liutauras Vilda
  • Jeanne Boyarsky
  • paul wheaton
Sheriffs:
  • Ron McLeod
  • Devaka Cooray
  • Henry Wong
Saloon Keepers:
  • Tim Holloway
  • Stephan van Hulst
  • Carey Brown
  • Tim Moores
  • Mikalai Zaikin
Bartenders:
  • Frits Walraven

generating tags when submit button in clicked

 
Greenhorn
Posts: 17
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi,
i have a simple javascript form with an image and a submit button in my 'home' page. when the image is clicked, the user is taken to another page, 'page2' where he has a form with a select tag and some options. these options allow him to select an image from set of images.
now the user selects one of the options and the image he has chosen is displayed on the screen using an appropriate function.
the user then clicks on a 'back' button and returns to the 'home' page. here when he clicks on the 'submit' button, a XML file showing his selection is to be displayed ie XML looks like
<choice>
<figure>D:\My Documents\af.jpg</figure>
</choice>
the figure tag is dynamic and changes depending on the value chosen by the user.
i have the code by which the above XML is generated but it works only in page2 ie as soon as the user makes his selection, the image is displayed and simultaneously the above XML is also generated in a separate window.
instead i want this XML to be generated ONLY WHEN THE USER CLICKS ON THE SUBMIT BUTTON in the home page.
thanks in advance.
 
Ranch Hand
Posts: 85
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
If I followed you right in your specification, read the code right and assumed rightly that the function you have constructed that fires up on onclick event creates the things you want up to and including xml and you want only xml to be generated by onclick, then I think you should try to separate xml generating process into new function...
I hope this helped, but I apologize if I misunderstood you...
[ May 07, 2004: Message edited by: Gjorgi Var ]
 
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
If you want to display the images alone, use the same loadfile() method in the onChange event of Select object, like this
<select name="sel" onChange="loadfile()"> , this will show the images in new page ,whenever you choose the particular image.
u can right a new method in submit button for different purpose.

Oli
 
They weren't very bright, but they were very, very big. Ad contrast:
Gift giving made easy with the permaculture playing cards
https://coderanch.com/t/777758/Gift-giving-easy-permaculture-playing
reply
    Bookmark Topic Watch Topic
  • New Topic