Solved

input text field

Posted on 2007-04-08
5
143 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 49

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

How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

Join & Write a Comment

Suggested Solutions

Not sure what the best email signature size is? Are you worried about email signature image size? Follow this best practice guide.
This article demonstrates how to create a simple responsive confirmation dialog with Ok and Cancel buttons using HTML, CSS, jQuery and Promises
In this tutorial viewers will learn how add a full-size background image to a webpage using CSS3. Create a new HTML document with an internal stylesheet.: In CSS, define the html element to have a background image. Use a high resolution image.: In t…
In this tutorial viewers will learn how to style a corner ribbon overlay for an image using CSS Create a new class by typing ".Ribbon":  Define the class' "display:" as "inline-block": Define its "position:" as "relative": Define its "overflow:" as …

708 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

Need Help in Real-Time?

Connect with top rated Experts

14 Experts available now in Live!

Get 1:1 Help Now