Solved

input text field

Posted on 2007-04-08
5
146 Views
Last Modified: 2010-04-09
I have a input field to keep a value from the previous page like below.
<input type="text" name="d1" value="previous_page">
But what i am trying to do is to change the value of d1 and send new value to next page.

<form name="nextpage" action="nextpage.html">
<input type="text" name="d1" value="{$previous_page}">
</form>

How can i send a new value to nextpage??

0
Comment
Question by:bbvic
  • 3
5 Comments
 
LVL 50

Expert Comment

by:Ryan Chong
ID: 18874023
before the page is submitted, you can try to change its value via javascript, like this...

<script language="javascript">
    function validate(frm) {
      frm.d1.value = "{ new Value.... }";
      return true;
   }
</script>
<form name="nextpage" action="nextpage.html" onsubmit="return validate(this)">
<input type="text" name="d1" value="{$previous_page}">
</form>
0
 
LVL 8

Expert Comment

by:jawahar_prasad
ID: 18875170
Hi...
TRY THIS..

<html><head>
<script language="javascript">
   function fn_setval() {
     document.nextpage.d1.value = "<New Value>";
     document.nextpage.submit();
   }
</script>
</head>
<body>
<form name="nextpage" action="nextpage.html">
<input type="text" name="d1" value="{$previous_page}">
<input type="button" onclick="fn_setval();" value="as">
</form>
</body>
</html>
0
 
LVL 8

Expert Comment

by:radnor
ID: 18875674
Do you have PHP available?
0
 
LVL 8

Expert Comment

by:radnor
ID: 18875688
If not, you could try a cookie....
0
 
LVL 8

Accepted Solution

by:
radnor earned 500 total points
ID: 18875694
0

Featured Post

Gigs: Get Your Project Delivered by an Expert

Select from freelancers specializing in everything from database administration to programming, who have proven themselves as experts in their field. Hire the best, collaborate easily, pay securely and get projects done right.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Not sure what the best email signature size is? Are you worried about email signature image size? Follow this best practice guide.
Is your Office 365 signature not working the way you want it to? Are signature updates taking up too much of your time? Let's run through the most common problems that an IT administrator can encounter when dealing with Office 365 email signatures.
In this tutorial viewers will learn how to embed an audio file in a webpage using HTML5. Ensure your DOCTYPE declaration is set to HTML5: : The declaration should display (CODE) HTML5 is supported by the most recent versions of all major browsers…
The viewer will learn the basics of jQuery, including how to invoke it on a web page. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery.: (CODE)

776 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question