SitePoint Sponsor |
|
User Tag List
Results 1 to 4 of 4
Hybrid View
-
Sep 18, 2002, 05:50 #1
- Join Date
- Sep 2002
- Posts
- 161
- Mentioned
- 0 Post(s)
- Tagged
- 0 Thread(s)
Using JavaScript for dynamic content
I need to know if I can do the following with JavaScript. I have a course page and when the user clicks on "Enrol Now" I want the form to pass the course name and price onto the Enrolment page and dynamically print the course name and the price on the enrolment page. The course page can be a form.
In simple steps:
<User Clicks On "Enrol Now" Button> course.html
<User is taken to enrolment page, I want to be able to pass the course name and price onto the enrolment page from course.html, and print it here> enrolment.html
Im wondering if i can use a "Hidden" Input field to define the Course name & Price in course.html and when the user clicks on "Enrol Now", which is a button, the form takes the hidden fields and uses javascript to display them on the enrolment.html page. Is it possible to do this with plain HTML, I could not think of a solution with just HTML.
Any advice would be greatly appreciated!
-
Sep 21, 2002, 17:44 #2
- Join Date
- Jan 2000
- Location
- Charlotte, NC
- Posts
- 5,891
- Mentioned
- 0 Post(s)
- Tagged
- 0 Thread(s)
Moved to appropriate forum.
-
Sep 22, 2002, 15:11 #3
Where is this question moved ?
tx
-
Sep 27, 2002, 07:01 #4
- Join Date
- Aug 2002
- Posts
- 180
- Mentioned
- 0 Post(s)
- Tagged
- 0 Thread(s)
Code:<script Language="JavaScript"> var mainthing var price var price2 var course mainthing = parent.document.URL; if (mainthing.indexOf('?price=') != -1) { price = mainthing.substring(mainthing.indexOf('?price')+1,mainthing.length); course = price.substring(price.indexOf('&course=')+1,price.length); price2 = mainthing.substring(mainthing.indexOf('?price')+1,(mainthing.lengh)-(course.length)-8); } document.write('<p>'+price2+'</p>'); document.write('<p>'+course+'</p>'); </script>
this is not the most practicle thing in the world, a serverside language would be much more useful...
Bookmarks