HTML Programming
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me
Go Back   Dev Shed ForumsWeb DesignHTML Programming

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Dev Shed Forums Sponsor:
  #1  
Old November 10th, 2000, 10:56 PM
Bartel Diks Bartel Diks is offline
Junior Member
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Nov 2000
Posts: 1 Bartel Diks User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
I am trying to submit a form using the document object in a JavaScript (client) function. My problem is that it doesn't work if my target frame is the same as the current frame I am in---it only works if the target frame is different. However, when I don't use JavaScript, but instead assign the form attribute values in my HTML---it DOES work. When it works, my current frame changes to the new page I am sending to the frame. When it doesn't work, the frame doesn't change but just retains the current page. The following Example 1 is the JavaScript that does NOT work (along with the HTML form tag info). Example 2 is the pure HTML solution that does work (as you can see I have to include the "submit" input type button, which I don't want to do).
Thanks. Bartel.

Example 1 (DOES NOT work!)

document.MyFormName.method = "post";
document.MyFormName.action = "my.asp";
document.MyFormName.value = "add";
document.MyFormName.target = "MyFrame";
document.MyFormName.MyInputName.value = "MyValue";
document.MyFormName.submit();

<form name="MyFormName">
<input type="hidden" name="MyInputName">
</form>


Example 2 (works!)

<form name="MyFormName" method="post" action="my.asp" value="add" target="MyFrame">
<input name="MyInputName" type="submit" value="MyValue">
</form>


Reply With Quote
Reply

Viewing: Dev Shed ForumsWeb DesignHTML Programming > Frame not displaying using document object


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 5 hosted by Hostway
Stay green...Green IT