form question 
Author Message
 form question

I have a javascript that generates a particular string.  How can I put that
string into a form field and submit it?  (it doesn't necessarily have to be
an auto-submit, though that would be nice).


Wed, 08 Sep 2004 00:53:19 GMT  
 form question
Something like so:

  <form name="aForm" action="whatever.asp" method="post">
  <input type="text" name="field" value="">
  </form>

  <script language="JavaScript" type="text/javascript">
  <!--
  function particularString() {
    return "A particular string";
  }

  var aForm = document.forms.aForm;
  aForm.field.value = particularString();
  aForm.submit(); // optional
  // -->
  </script>

Enjoy,
Jim Rofkar.


| I have a javascript that generates a particular string.  How can I put that
| string into a form field and submit it?  (it doesn't necessarily have to be
| an auto-submit, though that would be nice).



Wed, 08 Sep 2004 23:51:35 GMT  
 
 [ 2 post ] 

 Relevant Pages 

1. dynamic form question?

2. Form Question Need Help!!!

3. E-mail form Question??

4. vbscript email form question

5. Many to Many Database Form Questions?

6. Newbie script form question

7. FORM question

8. This is more a forms question then a scripting one...

9. Form value to Form value * advanced question

10. HTML form object model questions

11. form validation question

12. Email form in Js question !!!

 

 
Powered by phpBB® Forum Software